├── .gitignore ├── AUTHORS ├── CONTRIBUTING ├── CONTRIBUTORS ├── LICENSE ├── README.md ├── example ├── c_example │ └── example_triangle.c └── dart_example │ ├── example_triangle.dart │ ├── limits.dart │ └── minimal.dart ├── lib ├── Makefile ├── gl.dart └── src │ ├── generated │ ├── function_list.cc │ ├── function_list.h │ ├── gl_bindings.cc │ ├── gl_bindings.h │ ├── gl_constants.dart │ └── gl_native_functions.dart │ ├── gl_extension.cc │ ├── gl_extension.h │ ├── gl_extension_info.cc │ ├── gl_extension_info.h │ ├── instantiate_gl_classes.cc │ ├── instantiate_gl_classes.h │ ├── manual_bindings.cc │ ├── manual_bindings.dart │ ├── manual_bindings.h │ ├── util.cc │ └── util.h ├── pubspec.yaml └── tools └── gl_generator.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Don’t commit the following files or directories created by pub. 2 | .packages 3 | .pub/ 4 | build/ 5 | packages/ 6 | 7 | # according to https://www.dartlang.org/tools/pub/package-layout.html 8 | # pubspec.lock is not included if not application package 9 | # remove this line if your package is an application package 10 | pubspec.lock 11 | 12 | # Files created by dart2js. 13 | *.dart.js 14 | *.dart.precompiled.js 15 | *.js_ 16 | *.js.deps 17 | *.js.map 18 | 19 | # Don't commit python bytecode files in the tools/ directory. 20 | *.pyc 21 | 22 | # Don't commit compile artifacts 23 | *.o 24 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Google Inc. 2 | -------------------------------------------------------------------------------- /CONTRIBUTING: -------------------------------------------------------------------------------- 1 | Want to contribute? Great! First, read this page (including the small print at 2 | the end). 3 | 4 | ### Before you contribute 5 | Before we can use your code, you must sign the 6 | [Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1) 7 | (CLA), which you can do online. The CLA is necessary mainly because you own the 8 | copyright to your changes, even after your contribution becomes part of our 9 | codebase, so we need your permission to use and distribute your code. We also 10 | need to be sure of various other things—for instance that you'll tell us if you 11 | know that your code infringes on other people's patents. You don't have to sign 12 | the CLA until after you've submitted your code for review and a member has 13 | approved it, but you must do it before we can put your code into our codebase. 14 | Before you start working on a larger contribution, you should get in touch with 15 | us first through the issue tracker with your idea so that we can help out and 16 | possibly guide you. Coordinating up front makes it much easier to avoid 17 | frustration later on. 18 | 19 | ### Code reviews 20 | All submissions, including submissions by project members, require review. We 21 | use Github pull requests for this purpose. 22 | 23 | ### The small print 24 | Contributions made by corporations are covered by a different agreement than 25 | the one above, the Software Grant and Corporate Contributor License Agreement. 26 | -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | "Harry Stern" 2 | "Jason Daly" 3 | "Todd Larsen" 4 | "Michael McLennan" 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015, the Dart GL extension authors. All rights reserved. 2 | Redistribution and use in source and binary forms, with or without 3 | modification, are permitted provided that the following conditions are 4 | met: 5 | 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above 9 | copyright notice, this list of conditions and the following 10 | disclaimer in the documentation and/or other materials provided 11 | with the distribution. 12 | * Neither the name of the copyright holder nor the names of its 13 | contributors may be used to endorse or promote products derived 14 | from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dart native extension for [GLES2](https://www.khronos.org/opengles/2_X/) 2 | 3 | Supports Linux and Windows. OSX is not supported due to inherent 4 | incompatibilites in the OSX UI threading model, as well as Apple announcing the 5 | discontinuing of support of OpenGL on OSX (https://goo.gl/qQdeQ5). 6 | 7 | # Steps to generate the bindings 8 | 9 | ```shell 10 | mkdir -p lib/src/generated 11 | pub run tools/gl_generator.dart 12 | clang-format -i --style=Google generated/*.{cc,h} 13 | dartfmt -w generated/*.dart 14 | mv generated/* lib/src/generated/ 15 | ``` 16 | 17 | ## Limiting bindings to actual symbols 18 | 19 | Some GL libraries come with headers that list functions not implemented. This 20 | will fail at link time. To avoid this, you can dump the symbols in libGLESv2.so 21 | to be used with `--limit-api` flag in`tools/gl_generator.dart` 22 | 23 | ```shell 24 | nm -D /lib/libGLESv2.so | grep " T " | awk '{print $3}' > limit.txt 25 | ``` 26 | 27 | # Steps to compile the bindings 28 | 29 | The previous method for compiling the bindings is no longer available. We are 30 | working on a new solution for both Linux and Windows. 31 | 32 | In the meantime, the Makefile in the lib/ directory is a good starting point for 33 | compiling on Linux. 34 | 35 | # Functions with interfaces with APIs different from GLES2 36 | 37 | If a function's only difference is moving pointer parameters to the return 38 | value, it is not listed. See `lib/src/manual_bindings.dart` for a full list. 39 | 40 | - `glGetActiveAttrib` doesn't take a bufSize parameter, and returns an 41 | `ActiveAttrib` instance. 42 | - `glGetActiveUniform` doesn't take a bufSize parameter, and returns an 43 | `ActiveAttrib` instance. 44 | - `glGetAttachedShaders` doesn't take a maxCount parameter, returns a 45 | `List`. 46 | - `glGetProgramInfoLog` doesn't take a maxSize parameter, and returns a 47 | `String`. 48 | - `glGetShaderPrecisionFormat` returns a `ShaderPrecisionFormat` instance. 49 | - `glGetShaderSource` doesn't take a bufSize parameter and just returns a 50 | `String`. 51 | - `glReadPixels` takes a `TypedData pixels` parameter and the data is put into 52 | it, like in the WebGL API. Your program will most likely crash if the 53 | TypedData object you pass in is not big enough, or possibly if it's in the 54 | wrong format. 55 | - `glShaderSource` just takes the parameters `int shader` and `String string`. 56 | The original API is not really appropriate for Dart. 57 | 58 | # A note about OpenGL, the Dart VM, and native threads 59 | 60 | OpenGL is a thread-bound API. That is, an OpenGL context must be bound (or "made 61 | current") on a thread before any other OpenGL functions may be called. 62 | 63 | The Dart VM uses a pool of native threads under the hood to carry out tasks on 64 | the event queue 65 | ([overview of the Dart event loop](https://webdev.dartlang.org/articles/performance/event-loop)). 66 | 67 | This leads to an unfortunate restriction on the use of asynchronous code while 68 | making OpenGL calls from Dart. This is bad: 69 | 70 | ```dart 71 | glfwMakeContextCurrent(context); 72 | 73 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 74 | // other OpenGL calls ... 75 | 76 | // Wait for an async task to finish. 77 | await someFuture; 78 | 79 | // Draw a triangle. 80 | glDrawArrays(GL_TRIANGLES, 0, 3); 81 | // etc... 82 | ``` 83 | 84 | The issue is that the context is made current, then there is a call to await, 85 | which causes the current task to return to the event loop until `someFuture` 86 | completes. When control returns to the next line, it may be running on a 87 | completely different native thread, where the context is not bound. 88 | 89 | To avoid this issue, the code must be changed to something resembling the 90 | following: 91 | 92 | ```dart 93 | glfwMakeContextCurrent(context); 94 | 95 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 96 | // other OpenGL calls ... 97 | 98 | // Release the context before waiting. 99 | glfwMakeContextCurrent(NULL); 100 | 101 | // Wait for an async task to finish. 102 | await someFuture; 103 | 104 | // We're back! Reacquire the context. 105 | glfwMakeContextCurrent(context); 106 | 107 | // Draw a triangle. 108 | glDrawArrays(GL_TRIANGLES, 0, 3); 109 | // etc... 110 | ``` 111 | 112 | This way, the context is released from the thread before control returns to the 113 | event loop and then reacquired when it comes back. 114 | 115 | Note that this applies to any asynchronous code (not just an await). Here's 116 | another bad example: 117 | 118 | ```dart 119 | glfwMakeContextCurrent(context); 120 | 121 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 122 | // other OpenGL calls ... 123 | 124 | // Load an image, then create a texture. 125 | var f = new File("image.rgb"); 126 | f.readFileAsBytes().then((bytes) { 127 | var tex = glGenTextures(1); 128 | glBindTexture(GL_TEXTURE_2D, tex); 129 | glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA, width, height, 0, GL_UNSIGNED_BYTE, 130 | GL_RGBA, bytes); 131 | }); 132 | 133 | // etc... 134 | ``` 135 | 136 | In this case, there's no guarantee that the callback to the `Future` returned by 137 | `readFileAsBytes` would be running on the same thread as the original task. 138 | 139 | In practice, most OpenGL code is written synchronously, as it's generally not 140 | advisable to be waiting for other tasks to complete while in the middle of 141 | rendering a frame. However, it's important to be aware of this restriction. When 142 | making OpenGL calls, either avoid awaiting asynchronous methods and making 143 | OpenGL calls in async callbacks, or properly release the context anytime control 144 | returns to the event loop, and reacquire it when ready to make OpenGL calls 145 | again. 146 | -------------------------------------------------------------------------------- /example/c_example/example_triangle.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "third_party/GL/GLFW/include/GLFW/glfw3.h" 11 | 12 | GLuint vbo; 13 | 14 | GLuint v_shader, f_shader, shader_program; 15 | 16 | const float verts[] = {-1.0, -1.0, 0.0, 1.0, 1.0, -1.0, 17 | 0.0, 1.0, 0.0, 1.0, 0.0, 1.0}; 18 | 19 | const GLchar vs[] = 20 | "#version 100\n" 21 | "in vec4 position;\n" 22 | "void main() {\n" 23 | " gl_Position = position;\n" 24 | "}\n"; 25 | 26 | const GLchar fs[] = 27 | "#version 100\n" 28 | "void main() {\n" 29 | " gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n" 30 | "}\n"; 31 | 32 | void check_error() { 33 | GLenum err; 34 | while ((err = glGetError()) != GL_NO_ERROR) { 35 | fprintf(stderr, "OpenGL error: %d\n", err); 36 | } 37 | } 38 | 39 | void get_shader_error(GLuint shader) { 40 | GLint infoLogLength; 41 | glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLogLength); 42 | 43 | GLchar *strInfoLog = (GLchar *)malloc(infoLogLength + 1); 44 | glGetShaderInfoLog(shader, infoLogLength, NULL, strInfoLog); 45 | 46 | fprintf(stderr, "%d\n", infoLogLength); 47 | 48 | fprintf(stderr, "Compile failure in shader:\n%s\n", strInfoLog); 49 | } 50 | 51 | void setup_buffers() { 52 | glGenBuffers(1, &vbo); 53 | 54 | glBindBuffer(GL_ARRAY_BUFFER, vbo); 55 | glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_STATIC_DRAW); 56 | 57 | glEnableVertexAttribArray(0); 58 | glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, (void *)NULL); 59 | } 60 | 61 | void setup_shaders() { 62 | v_shader = glCreateShader(GL_VERTEX_SHADER); 63 | f_shader = glCreateShader(GL_FRAGMENT_SHADER); 64 | 65 | const GLchar *vshader_text = strdup(vs); 66 | const GLchar *fshader_text = strdup(fs); 67 | 68 | glShaderSource(v_shader, 1, &vshader_text, NULL); 69 | glShaderSource(f_shader, 1, &fshader_text, NULL); 70 | 71 | glCompileShader(v_shader); 72 | glCompileShader(f_shader); 73 | 74 | shader_program = glCreateProgram(); 75 | 76 | glAttachShader(shader_program, v_shader); 77 | glAttachShader(shader_program, f_shader); 78 | glLinkProgram(shader_program); 79 | 80 | glUseProgram(shader_program); 81 | } 82 | 83 | void render_triangle() { 84 | glBindBuffer(GL_ARRAY_BUFFER, vbo); 85 | glEnableVertexAttribArray(0); 86 | glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, (void *)NULL); 87 | 88 | glUseProgram(shader_program); 89 | glDrawArrays(GL_TRIANGLES, 0, 3); 90 | } 91 | 92 | int main() { 93 | GLFWwindow *window; 94 | 95 | if (!glfwInit()) { 96 | return -1; 97 | } 98 | 99 | glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); 100 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); 101 | 102 | window = glfwCreateWindow(1280, 720, "Example triangle.", NULL, NULL); 103 | if (!window) { 104 | glfwTerminate(); 105 | return -1; 106 | } 107 | 108 | glfwMakeContextCurrent(window); 109 | 110 | printf("%s\n", glGetString(GL_VERSION)); 111 | 112 | setup_buffers(); 113 | setup_shaders(); 114 | 115 | glViewport(0, 0, 1280, 720); 116 | glClearColor(0.0f, 0.0f, 0.0f, 1.0f); 117 | 118 | while (!glfwWindowShouldClose(window)) { 119 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 120 | render_triangle(); 121 | 122 | glfwSwapBuffers(window); 123 | glfwPollEvents(); 124 | } 125 | 126 | glfwTerminate(); 127 | 128 | return 0; 129 | } 130 | -------------------------------------------------------------------------------- /example/dart_example/example_triangle.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | import 'dart:io'; 7 | import 'dart:typed_data'; 8 | 9 | import 'package:gl/gl.dart'; 10 | import 'package:glfw/glfw.dart'; 11 | 12 | int vbo; 13 | 14 | int v_shader, f_shader, shader_program; 15 | 16 | Float32List verts = new Float32List.fromList(const [ 17 | -1.0, -1.0, 1.0, 0.0, 0.0, 1.0, // x, y, r, g, b, a 18 | 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 19 | 1.0, -1.0, 0.0, 0.0, 1.0, 1.0, 20 | ]); 21 | const int float32Size = Float32List.bytesPerElement; 22 | 23 | const String vshader_text = """ 24 | #version 100 25 | attribute vec4 position; 26 | attribute vec4 color; 27 | varying vec4 vcolor; 28 | 29 | void main() { 30 | gl_Position = position; 31 | vcolor = color; 32 | } 33 | """; 34 | 35 | const String fshader_text = """ 36 | #version 100 37 | precision mediump float; 38 | varying vec4 vcolor; 39 | 40 | void main() { 41 | gl_FragColor = vcolor; 42 | } 43 | """; 44 | 45 | void check_error() { 46 | int err = glGetError(); 47 | while (err != GL_NO_ERROR) { 48 | stderr.writeln("OpenGL error: $err"); 49 | err = glGetError(); 50 | } 51 | } 52 | 53 | void get_shader_error(int shader) { 54 | int err = glGetShaderiv(shader, GL_COMPILE_STATUS); 55 | if (err == GL_FALSE) { 56 | String strInfoLog = glGetShaderInfoLog(shader); 57 | if (strInfoLog.length > 0) { 58 | stderr.writeln("Compile failure in shader:\n$strInfoLog\n"); 59 | 60 | String shaderSource = glGetShaderSource(shader); 61 | stderr.writeln("Shader source: \n$shaderSource\n"); 62 | } 63 | } 64 | } 65 | 66 | void get_program_error(int program) { 67 | int err = glGetProgramiv(program, GL_LINK_STATUS); 68 | if (err == GL_FALSE) { 69 | String strInfoLog = glGetProgramInfoLog(program); 70 | if (strInfoLog.length > 0) { 71 | stderr.writeln("Program error:\n$strInfoLog\n"); 72 | } 73 | } 74 | } 75 | 76 | void setup_buffers() { 77 | vbo = glGenBuffers(1).first; 78 | 79 | glBindBuffer(GL_ARRAY_BUFFER, vbo); 80 | glBufferData( 81 | GL_ARRAY_BUFFER, verts.length * float32Size, verts, GL_STATIC_DRAW); 82 | 83 | check_error(); 84 | } 85 | 86 | void setup_shaders() { 87 | v_shader = glCreateShader(GL_VERTEX_SHADER); 88 | f_shader = glCreateShader(GL_FRAGMENT_SHADER); 89 | 90 | glShaderSource(v_shader, vshader_text); 91 | glShaderSource(f_shader, fshader_text); 92 | 93 | glCompileShader(v_shader); 94 | get_shader_error(v_shader); 95 | 96 | glCompileShader(f_shader); 97 | get_shader_error(f_shader); 98 | check_error(); 99 | 100 | shader_program = glCreateProgram(); 101 | 102 | glAttachShader(shader_program, v_shader); 103 | glAttachShader(shader_program, f_shader); 104 | glLinkProgram(shader_program); 105 | get_program_error(shader_program); 106 | check_error(); 107 | 108 | glUseProgram(shader_program); 109 | get_program_error(shader_program); 110 | check_error(); 111 | } 112 | 113 | void render_triangle() { 114 | glBindBuffer(GL_ARRAY_BUFFER, vbo); 115 | 116 | var vertexId = glGetAttribLocation(shader_program, 'position'); 117 | glEnableVertexAttribArray(vertexId); 118 | glVertexAttribPointer( 119 | vertexId, // Describe vertex information. 120 | 2, // Two values: x, y 121 | GL_FLOAT, // Each has sizeof float. 122 | false, // Don't normalize values. 123 | 6 * float32Size, // Stride to next vertex is 6 elements. 124 | 0); // Offset to vertex info. 125 | 126 | var colorId = glGetAttribLocation(shader_program, 'color'); 127 | glEnableVertexAttribArray(colorId); 128 | glVertexAttribPointer( 129 | colorId, // Describe color information. 130 | 4, // Four values: r, g, b, a 131 | GL_FLOAT, // Each has sizeof float. 132 | false, // Don't normalize values. 133 | 6 * float32Size, // Stride to next vertex is 6 elements. 134 | 2 * float32Size); // Offset to vertex info (skip x,y). 135 | 136 | glUseProgram(shader_program); 137 | glDrawArrays(GL_TRIANGLES, 0, 3); 138 | check_error(); 139 | } 140 | 141 | void main() { 142 | glfwInit(); 143 | 144 | glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); 145 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); 146 | 147 | GLFWwindow window = 148 | glfwCreateWindow(1280, 720, "Hello Dart GLFW", null, null); 149 | 150 | glfwMakeContextCurrent(window); 151 | print(glGetString(GL_VERSION)); 152 | 153 | setup_buffers(); 154 | setup_shaders(); 155 | 156 | glViewport(0, 0, 1280, 720); 157 | glClearColor(0.0, 0.0, 0.0, 1.0); 158 | 159 | while (!glfwWindowShouldCloseAsBool(window)) { 160 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 161 | render_triangle(); 162 | 163 | glfwSwapBuffers(window); 164 | glfwPollEvents(); 165 | } 166 | glfwTerminate(); 167 | } 168 | -------------------------------------------------------------------------------- /example/dart_example/limits.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | import 'package:gl/gl.dart'; 7 | import 'package:glfw/glfw.dart'; 8 | 9 | void main() { 10 | glfwInit(); 11 | 12 | glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); 13 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); 14 | 15 | GLFWwindow window = glfwCreateWindow(100, 100, "", null, null); 16 | 17 | glfwMakeContextCurrent(window); 18 | print(glGetString(GL_VERSION)); 19 | print("Bits: r:${glGetIntegerv(GL_RED_BITS).single} " 20 | "g:${glGetIntegerv(GL_GREEN_BITS).single} " 21 | "b:${glGetIntegerv(GL_BLUE_BITS).single} " 22 | "a:${glGetIntegerv(GL_ALPHA_BITS).single}"); 23 | print(" depth:${glGetIntegerv(GL_DEPTH_BITS).single} " 24 | "stencil:${glGetIntegerv(GL_STENCIL_BITS).single}"); 25 | var writemask = glGetBooleanv(GL_COLOR_WRITEMASK); 26 | print("Color Writemask: r:${writemask[0]} g:${writemask[1]} " 27 | "b:${writemask[2]} a:${writemask[3]}"); 28 | var viewport = glGetIntegerv(GL_VIEWPORT); 29 | print("Viewport: x:${viewport[0]} y:${viewport[1]} " 30 | "w:${viewport[2]} h:${viewport[3]}"); 31 | var depthRange = glGetFloatv(GL_DEPTH_RANGE); 32 | var intDepthRange = glGetIntegerv(GL_DEPTH_RANGE); 33 | print("Depth range: ${depthRange[0]} - ${depthRange[1]} " 34 | "(${intDepthRange[0]} - ${intDepthRange[1]})"); 35 | print(""); 36 | print("Max Texture Units:"); 37 | print(" Vertex: ${glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS)}"); 38 | print(" Fragment: ${glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS)}"); 39 | print(" Combined: ${glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS)}"); 40 | print("Max Uniform Vectors:"); 41 | print(" Vertex: ${glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS)}"); 42 | print(" Fragment: ${glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS)}"); 43 | print("Max Vertex Attributes: ${glGetIntegerv(GL_MAX_VERTEX_ATTRIBS)}"); 44 | print("Max Varying Vectors: ${glGetIntegerv(GL_MAX_VARYING_VECTORS)}"); 45 | print(""); 46 | var formats = glGetIntegerv(GL_SHADER_BINARY_FORMATS) 47 | .map((fmt) => "0x${fmt.toRadixString(16)}") 48 | .toList(); 49 | print("Shader Binary Formats: $formats"); 50 | formats = glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS) 51 | .map((fmt) => "0x${fmt.toRadixString(16)}") 52 | .toList(); 53 | print("Compressed Texture Formats: $formats"); 54 | 55 | var empty = glGetIntegerv(0xf00d); 56 | if (empty.isNotEmpty) { 57 | throw new ArgumentError("ERROR! Got data for an invalid GLenum!"); 58 | } 59 | 60 | var extensions = glGetString(GL_EXTENSIONS).split(' '); 61 | print("Extensions:"); 62 | for (var extension in extensions) { 63 | print(" $extension"); 64 | } 65 | glfwSetWindowShouldClose(window, GL_TRUE); 66 | glfwTerminate(); 67 | } 68 | -------------------------------------------------------------------------------- /example/dart_example/minimal.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | import 'package:gl/gl.dart'; 7 | import 'package:glfw/glfw.dart'; 8 | 9 | void main() { 10 | glfwInit(); 11 | 12 | glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); 13 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); 14 | 15 | GLFWwindow window = glfwCreateWindow(1280, 720, "", null, null); 16 | 17 | glfwMakeContextCurrent(window); 18 | print(glGetString(GL_VERSION)); 19 | 20 | var shader = glGetIntegerv(GL_CURRENT_PROGRAM); 21 | print('shader program: $shader'); 22 | 23 | // Note that boolean arguments (e.g., GL_TRUE below) are integer values 24 | // (consistent with OpenGL), but return values are boolean to simplify 25 | // the handling of return results. 26 | print('close status: ${glfwWindowShouldCloseAsBool(window)}'); 27 | print('closing...'); 28 | glfwSetWindowShouldClose(window, GL_TRUE); 29 | print('close status: ${glfwWindowShouldCloseAsBool(window)}'); 30 | 31 | glfwTerminate(); 32 | } 33 | -------------------------------------------------------------------------------- /lib/Makefile: -------------------------------------------------------------------------------- 1 | CC=clang++ 2 | CFLAGS = -Wall -Werror 3 | 4 | ifneq ($(strip $(GL_INCLUDE)),) 5 | CFLAGS += -I$(GL_INCLUDE) 6 | endif 7 | 8 | ifneq ($(strip $(DART_INCLUDE)),) 9 | CFLAGS += -I$(DART_INCLUDE) 10 | endif 11 | 12 | CFLAGS += -fPIC -DDART_SHARED_LIB -std=c++11 13 | 14 | 15 | LDFLAGS = -shared -Wl,-soname=libgl_extension.so 16 | 17 | ifneq ($(strip $(GL_LIB)),) 18 | LDFLAGS += -L$(GL_LIB) 19 | endif 20 | 21 | ifneq ($(strip $(GL_LIB_NAME)),) 22 | LDFLAGS += -l$(GL_LIB) 23 | else 24 | LDFLAGS += -lGL 25 | endif 26 | 27 | 28 | all: gl_extension 29 | 30 | OBJS = src/gl_extension.o src/gl_extension_info.o src/instantiate_gl_classes.o src/manual_bindings.o src/util.o src/generated/function_list.o src/generated/gl_bindings.o 31 | 32 | gl_extension: $(OBJS) 33 | $(CC) $(OBJS) $(LDFLAGS) -o libgl_extension.so 34 | 35 | src/gl_extension.o: src/gl_extension.cc 36 | $(CC) $(CFLAGS) -c $< -o $@ 37 | 38 | src/gl_extension_info.o: src/gl_extension_info.cc 39 | $(CC) $(CFLAGS) -c $< -o $@ 40 | 41 | src/instantiate_gl_classes.o: src/instantiate_gl_classes.cc 42 | $(CC) $(CFLAGS) -c $< -o $@ 43 | 44 | src/manual_bindings.o: src/manual_bindings.cc 45 | $(CC) $(CFLAGS) -c $< -o $@ 46 | 47 | src/util.o: src/util.cc 48 | $(CC) $(CFLAGS) -c $< -o $@ 49 | 50 | src/generated/function_list.o: src/generated/function_list.cc 51 | $(CC) $(CFLAGS) -c $< -o $@ 52 | 53 | src/generated/gl_bindings.o: src/generated/gl_bindings.cc 54 | $(CC) $(CFLAGS) -c $< -o $@ 55 | 56 | clean: 57 | rm src/*.o src/generated/*.o libgl_extension.so 58 | -------------------------------------------------------------------------------- /lib/gl.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | library gl; 7 | 8 | /// A Dart library which uses a native extension to call OpenGL ES2 functions. 9 | /// 10 | /// This library provides a wrapper for the OpenGL ES2 API. 11 | /// 12 | /// Please see the README.md and the 13 | /// [OpenGL ES2 man pages](https://www.khronos.org/opengles/sdk/docs/man/) 14 | /// for more detail. 15 | 16 | import 'dart-ext:gl_extension'; 17 | import 'dart:typed_data' show TypedData; 18 | 19 | export 'src/generated/gl_constants.dart'; 20 | 21 | part 'src/generated/gl_native_functions.dart'; 22 | part 'src/manual_bindings.dart'; 23 | 24 | /// Contains data returned by [glGetActiveAttrib] or [glGetActiveUniform] 25 | /// calls. 26 | class ActiveInfo { 27 | /// Returns the size of the attribute variable. 28 | final int size; 29 | 30 | /// Returns the data type of the attribute variable. 31 | final int type; 32 | 33 | /// Returns the [String] containing the name of the attribute variable. 34 | final String name; 35 | 36 | ActiveInfo(this.size, this.type, this.name); 37 | } 38 | 39 | /// Contains data returned by [glGetShaderPrecisionFormat] about the 40 | /// range and precision for different shader numeric (floating point and 41 | /// integer) shader variable formats. 42 | class ShaderPrecisionFormat { 43 | /// The precision of the format. 44 | final int precision; 45 | 46 | /// The maximum representable magnitude of the format. 47 | final int rangeMax; 48 | 49 | /// The minimum representable magnitude of the format. 50 | final int rangeMin; 51 | ShaderPrecisionFormat(this.rangeMin, this.rangeMax, this.precision); 52 | } 53 | -------------------------------------------------------------------------------- /lib/src/generated/function_list.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | // This file is auto-generated by scripts in the tools/ directory. 7 | 8 | #ifndef DART_GL_LIB_SRC_GENERATED_FUNCTION_LIST_H_ 9 | #define DART_GL_LIB_SRC_GENERATED_FUNCTION_LIST_H_ 10 | 11 | #include 12 | #include "dart_api.h" 13 | 14 | #if defined(WIN32) 15 | #include 16 | #if !defined(APIENTRY) 17 | #define APIENTRY __stdcall 18 | #endif 19 | #define _dlopen(name) LoadLibraryA(name) 20 | #define _dlclose(handle) FreeLibrary((HMODULE)handle) 21 | #define _dlsym(handle, name) GetProcAddress((HMODULE)handle, name) 22 | #else 23 | #include 24 | #define APIENTRY 25 | #define _dlopen(name) dlopen(name, RTLD_LAZY | RTLD_LOCAL) 26 | #define _dlclose(handle) dlclose(handle) 27 | #define _dlsym(handle, name) dlsym(handle, name) 28 | #endif 29 | 30 | struct FunctionLookup { 31 | const char* name; 32 | Dart_NativeFunction function; 33 | }; 34 | 35 | extern const struct FunctionLookup* function_list; 36 | 37 | // Attempt to load functions from gl2ext 38 | void loadFunctions(); 39 | 40 | // Dynamically loaded functions. 41 | typedef void(APIENTRY* PFGLBLENDBARRIERKHR)(); 42 | typedef void(APIENTRY* PFGLDEBUGMESSAGEINSERTKHR)(GLenum, GLenum, GLuint, 43 | GLenum, GLsizei, 44 | const GLchar*); 45 | typedef void(APIENTRY* PFGLPUSHDEBUGGROUPKHR)(GLenum, GLuint, GLsizei, 46 | const GLchar*); 47 | typedef void(APIENTRY* PFGLPOPDEBUGGROUPKHR)(); 48 | typedef void(APIENTRY* PFGLOBJECTLABELKHR)(GLenum, GLuint, GLsizei, 49 | const GLchar*); 50 | typedef void(APIENTRY* PFGLOBJECTPTRLABELKHR)(const void*, GLsizei, 51 | const GLchar*); 52 | typedef GLenum(APIENTRY* PFGLGETGRAPHICSRESETSTATUSKHR)(); 53 | typedef void(APIENTRY* PFGLCOPYIMAGESUBDATAOES)(GLuint, GLenum, GLint, GLint, 54 | GLint, GLint, GLuint, GLenum, 55 | GLint, GLint, GLint, GLint, 56 | GLsizei, GLsizei, GLsizei); 57 | typedef void(APIENTRY* PFGLENABLEIOES)(GLenum, GLuint); 58 | typedef void(APIENTRY* PFGLDISABLEIOES)(GLenum, GLuint); 59 | typedef void(APIENTRY* PFGLBLENDEQUATIONIOES)(GLuint, GLenum); 60 | typedef void(APIENTRY* PFGLBLENDEQUATIONSEPARATEIOES)(GLuint, GLenum, GLenum); 61 | typedef void(APIENTRY* PFGLBLENDFUNCIOES)(GLuint, GLenum, GLenum); 62 | typedef void(APIENTRY* PFGLBLENDFUNCSEPARATEIOES)(GLuint, GLenum, GLenum, 63 | GLenum, GLenum); 64 | typedef void(APIENTRY* PFGLCOLORMASKIOES)(GLuint, GLboolean, GLboolean, 65 | GLboolean, GLboolean); 66 | typedef GLboolean(APIENTRY* PFGLISENABLEDIOES)(GLenum, GLuint); 67 | typedef void(APIENTRY* PFGLDRAWELEMENTSBASEVERTEXOES)(GLenum, GLsizei, GLenum, 68 | const void*, GLint); 69 | typedef void(APIENTRY* PFGLDRAWRANGEELEMENTSBASEVERTEXOES)(GLenum, GLuint, 70 | GLuint, GLsizei, 71 | GLenum, const void*, 72 | GLint); 73 | typedef void(APIENTRY* PFGLDRAWELEMENTSINSTANCEDBASEVERTEXOES)(GLenum, GLsizei, 74 | GLenum, 75 | const void*, 76 | GLsizei, GLint); 77 | typedef void(APIENTRY* PFGLFRAMEBUFFERTEXTUREOES)(GLenum, GLenum, GLuint, 78 | GLint); 79 | typedef void(APIENTRY* PFGLPROGRAMBINARYOES)(GLuint, GLenum, const void*, 80 | GLint); 81 | typedef GLboolean(APIENTRY* PFGLUNMAPBUFFEROES)(GLenum); 82 | typedef void(APIENTRY* PFGLPRIMITIVEBOUNDINGBOXOES)(GLfloat, GLfloat, GLfloat, 83 | GLfloat, GLfloat, GLfloat, 84 | GLfloat, GLfloat); 85 | typedef void(APIENTRY* PFGLMINSAMPLESHADINGOES)(GLfloat); 86 | typedef void(APIENTRY* PFGLPATCHPARAMETERIOES)(GLenum, GLint); 87 | typedef void(APIENTRY* PFGLTEXIMAGE3DOES)(GLenum, GLint, GLenum, GLsizei, 88 | GLsizei, GLsizei, GLint, GLenum, 89 | GLenum, const void*); 90 | typedef void(APIENTRY* PFGLTEXSUBIMAGE3DOES)(GLenum, GLint, GLint, GLint, GLint, 91 | GLsizei, GLsizei, GLsizei, GLenum, 92 | GLenum, const void*); 93 | typedef void(APIENTRY* PFGLCOPYTEXSUBIMAGE3DOES)(GLenum, GLint, GLint, GLint, 94 | GLint, GLint, GLint, GLsizei, 95 | GLsizei); 96 | typedef void(APIENTRY* PFGLCOMPRESSEDTEXIMAGE3DOES)(GLenum, GLint, GLenum, 97 | GLsizei, GLsizei, GLsizei, 98 | GLint, GLsizei, 99 | const void*); 100 | typedef void(APIENTRY* PFGLCOMPRESSEDTEXSUBIMAGE3DOES)(GLenum, GLint, GLint, 101 | GLint, GLint, GLsizei, 102 | GLsizei, GLsizei, GLenum, 103 | GLsizei, const void*); 104 | typedef void(APIENTRY* PFGLFRAMEBUFFERTEXTURE3DOES)(GLenum, GLenum, GLenum, 105 | GLuint, GLint, GLint); 106 | typedef void(APIENTRY* PFGLTEXBUFFEROES)(GLenum, GLenum, GLuint); 107 | typedef void(APIENTRY* PFGLTEXBUFFERRANGEOES)(GLenum, GLenum, GLuint, GLintptr, 108 | GLsizeiptr); 109 | typedef void(APIENTRY* PFGLTEXSTORAGE3DMULTISAMPLEOES)(GLenum, GLsizei, GLenum, 110 | GLsizei, GLsizei, 111 | GLsizei, GLboolean); 112 | typedef void(APIENTRY* PFGLTEXTUREVIEWOES)(GLuint, GLenum, GLuint, GLenum, 113 | GLuint, GLuint, GLuint, GLuint); 114 | typedef void(APIENTRY* PFGLBINDVERTEXARRAYOES)(GLuint); 115 | typedef void(APIENTRY* PFGLDELETEVERTEXARRAYSOES)(GLsizei, const GLuint*); 116 | typedef void(APIENTRY* PFGLGENVERTEXARRAYSOES)(GLsizei, GLuint*); 117 | typedef GLboolean(APIENTRY* PFGLISVERTEXARRAYOES)(GLuint); 118 | typedef void(APIENTRY* PFGLVIEWPORTARRAYVOES)(GLuint, GLsizei, const GLfloat*); 119 | typedef void(APIENTRY* PFGLVIEWPORTINDEXEDFOES)(GLuint, GLfloat, GLfloat, 120 | GLfloat, GLfloat); 121 | typedef void(APIENTRY* PFGLVIEWPORTINDEXEDFVOES)(GLuint, const GLfloat*); 122 | typedef void(APIENTRY* PFGLSCISSORARRAYVOES)(GLuint, GLsizei, const GLint*); 123 | typedef void(APIENTRY* PFGLSCISSORINDEXEDOES)(GLuint, GLint, GLint, GLsizei, 124 | GLsizei); 125 | typedef void(APIENTRY* PFGLSCISSORINDEXEDVOES)(GLuint, const GLint*); 126 | typedef void(APIENTRY* PFGLDEPTHRANGEARRAYFVOES)(GLuint, GLsizei, 127 | const GLfloat*); 128 | typedef void(APIENTRY* PFGLDEPTHRANGEINDEXEDFOES)(GLuint, GLfloat, GLfloat); 129 | typedef void(APIENTRY* PFGLGENPERFMONITORSAMD)(GLsizei, GLuint*); 130 | typedef void(APIENTRY* PFGLDELETEPERFMONITORSAMD)(GLsizei, GLuint*); 131 | typedef void(APIENTRY* PFGLBEGINPERFMONITORAMD)(GLuint); 132 | typedef void(APIENTRY* PFGLENDPERFMONITORAMD)(GLuint); 133 | typedef void(APIENTRY* PFGLBLITFRAMEBUFFERANGLE)(GLint, GLint, GLint, GLint, 134 | GLint, GLint, GLint, GLint, 135 | GLbitfield, GLenum); 136 | typedef void(APIENTRY* PFGLRENDERBUFFERSTORAGEMULTISAMPLEANGLE)(GLenum, GLsizei, 137 | GLenum, GLsizei, 138 | GLsizei); 139 | typedef void(APIENTRY* PFGLDRAWARRAYSINSTANCEDANGLE)(GLenum, GLint, GLsizei, 140 | GLsizei); 141 | typedef void(APIENTRY* PFGLDRAWELEMENTSINSTANCEDANGLE)(GLenum, GLsizei, GLenum, 142 | const void*, GLsizei); 143 | typedef void(APIENTRY* PFGLVERTEXATTRIBDIVISORANGLE)(GLuint, GLuint); 144 | typedef void(APIENTRY* PFGLCOPYTEXTURELEVELSAPPLE)(GLuint, GLuint, GLint, 145 | GLsizei); 146 | typedef void(APIENTRY* PFGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLE)(GLenum, GLsizei, 147 | GLenum, GLsizei, 148 | GLsizei); 149 | typedef void(APIENTRY* PFGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLE)(); 150 | typedef void(APIENTRY* PFGLDRAWARRAYSINSTANCEDBASEINSTANCEEXT)(GLenum, GLint, 151 | GLsizei, GLsizei, 152 | GLuint); 153 | typedef void(APIENTRY* PFGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXT)( 154 | GLenum, GLsizei, GLenum, const void*, GLsizei, GLuint); 155 | typedef void(APIENTRY* PFGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXT)( 156 | GLenum, GLsizei, GLenum, const void*, GLsizei, GLint, GLuint); 157 | typedef void(APIENTRY* PFGLBINDFRAGDATALOCATIONINDEXEDEXT)(GLuint, GLuint, 158 | GLuint, 159 | const GLchar*); 160 | typedef void(APIENTRY* PFGLBINDFRAGDATALOCATIONEXT)(GLuint, GLuint, 161 | const GLchar*); 162 | typedef GLint(APIENTRY* PFGLGETPROGRAMRESOURCELOCATIONINDEXEXT)(GLuint, GLenum, 163 | const GLchar*); 164 | typedef GLint(APIENTRY* PFGLGETFRAGDATAINDEXEXT)(GLuint, const GLchar*); 165 | typedef void(APIENTRY* PFGLBUFFERSTORAGEEXT)(GLenum, GLsizeiptr, const void*, 166 | GLbitfield); 167 | typedef void(APIENTRY* PFGLCLEARTEXIMAGEEXT)(GLuint, GLint, GLenum, GLenum, 168 | const void*); 169 | typedef void(APIENTRY* PFGLCLEARTEXSUBIMAGEEXT)(GLuint, GLint, GLint, GLint, 170 | GLint, GLsizei, GLsizei, 171 | GLsizei, GLenum, GLenum, 172 | const void*); 173 | typedef void(APIENTRY* PFGLCOPYIMAGESUBDATAEXT)(GLuint, GLenum, GLint, GLint, 174 | GLint, GLint, GLuint, GLenum, 175 | GLint, GLint, GLint, GLint, 176 | GLsizei, GLsizei, GLsizei); 177 | typedef void(APIENTRY* PFGLLABELOBJECTEXT)(GLenum, GLuint, GLsizei, 178 | const GLchar*); 179 | typedef void(APIENTRY* PFGLINSERTEVENTMARKEREXT)(GLsizei, const GLchar*); 180 | typedef void(APIENTRY* PFGLPUSHGROUPMARKEREXT)(GLsizei, const GLchar*); 181 | typedef void(APIENTRY* PFGLPOPGROUPMARKEREXT)(); 182 | typedef void(APIENTRY* PFGLGENQUERIESEXT)(GLsizei, GLuint*); 183 | typedef void(APIENTRY* PFGLDELETEQUERIESEXT)(GLsizei, const GLuint*); 184 | typedef GLboolean(APIENTRY* PFGLISQUERYEXT)(GLuint); 185 | typedef void(APIENTRY* PFGLBEGINQUERYEXT)(GLenum, GLuint); 186 | typedef void(APIENTRY* PFGLENDQUERYEXT)(GLenum); 187 | typedef void(APIENTRY* PFGLQUERYCOUNTEREXT)(GLuint, GLenum); 188 | typedef void(APIENTRY* PFGLENABLEIEXT)(GLenum, GLuint); 189 | typedef void(APIENTRY* PFGLDISABLEIEXT)(GLenum, GLuint); 190 | typedef void(APIENTRY* PFGLBLENDEQUATIONIEXT)(GLuint, GLenum); 191 | typedef void(APIENTRY* PFGLBLENDEQUATIONSEPARATEIEXT)(GLuint, GLenum, GLenum); 192 | typedef void(APIENTRY* PFGLBLENDFUNCIEXT)(GLuint, GLenum, GLenum); 193 | typedef void(APIENTRY* PFGLBLENDFUNCSEPARATEIEXT)(GLuint, GLenum, GLenum, 194 | GLenum, GLenum); 195 | typedef void(APIENTRY* PFGLCOLORMASKIEXT)(GLuint, GLboolean, GLboolean, 196 | GLboolean, GLboolean); 197 | typedef GLboolean(APIENTRY* PFGLISENABLEDIEXT)(GLenum, GLuint); 198 | typedef void(APIENTRY* PFGLDRAWELEMENTSBASEVERTEXEXT)(GLenum, GLsizei, GLenum, 199 | const void*, GLint); 200 | typedef void(APIENTRY* PFGLDRAWRANGEELEMENTSBASEVERTEXEXT)(GLenum, GLuint, 201 | GLuint, GLsizei, 202 | GLenum, const void*, 203 | GLint); 204 | typedef void(APIENTRY* PFGLDRAWELEMENTSINSTANCEDBASEVERTEXEXT)(GLenum, GLsizei, 205 | GLenum, 206 | const void*, 207 | GLsizei, GLint); 208 | typedef void(APIENTRY* PFGLDRAWARRAYSINSTANCEDEXT)(GLenum, GLint, GLsizei, 209 | GLsizei); 210 | typedef void(APIENTRY* PFGLDRAWELEMENTSINSTANCEDEXT)(GLenum, GLsizei, GLenum, 211 | const void*, GLsizei); 212 | typedef void(APIENTRY* PFGLDRAWTRANSFORMFEEDBACKEXT)(GLenum, GLuint); 213 | typedef void(APIENTRY* PFGLDRAWTRANSFORMFEEDBACKINSTANCEDEXT)(GLenum, GLuint, 214 | GLsizei); 215 | typedef void(APIENTRY* PFGLFRAMEBUFFERTEXTUREEXT)(GLenum, GLenum, GLuint, 216 | GLint); 217 | typedef void(APIENTRY* PFGLVERTEXATTRIBDIVISOREXT)(GLuint, GLuint); 218 | typedef void(APIENTRY* PFGLFLUSHMAPPEDBUFFERRANGEEXT)(GLenum, GLintptr, 219 | GLsizeiptr); 220 | typedef void(APIENTRY* PFGLDELETEMEMORYOBJECTSEXT)(GLsizei, const GLuint*); 221 | typedef GLboolean(APIENTRY* PFGLISMEMORYOBJECTEXT)(GLuint); 222 | typedef void(APIENTRY* PFGLMULTIDRAWARRAYSINDIRECTEXT)(GLenum, const void*, 223 | GLsizei, GLsizei); 224 | typedef void(APIENTRY* PFGLMULTIDRAWELEMENTSINDIRECTEXT)(GLenum, GLenum, 225 | const void*, GLsizei, 226 | GLsizei); 227 | typedef void(APIENTRY* PFGLRENDERBUFFERSTORAGEMULTISAMPLEEXT)(GLenum, GLsizei, 228 | GLenum, GLsizei, 229 | GLsizei); 230 | typedef void(APIENTRY* PFGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXT)(GLenum, GLenum, 231 | GLenum, GLuint, 232 | GLint, GLsizei); 233 | typedef void(APIENTRY* PFGLREADBUFFERINDEXEDEXT)(GLenum, GLint); 234 | typedef void(APIENTRY* PFGLPOLYGONOFFSETCLAMPEXT)(GLfloat, GLfloat, GLfloat); 235 | typedef void(APIENTRY* PFGLPRIMITIVEBOUNDINGBOXEXT)(GLfloat, GLfloat, GLfloat, 236 | GLfloat, GLfloat, GLfloat, 237 | GLfloat, GLfloat); 238 | typedef void(APIENTRY* PFGLRASTERSAMPLESEXT)(GLuint, GLboolean); 239 | typedef GLenum(APIENTRY* PFGLGETGRAPHICSRESETSTATUSEXT)(); 240 | typedef void(APIENTRY* PFGLGENSEMAPHORESEXT)(GLsizei, GLuint*); 241 | typedef void(APIENTRY* PFGLDELETESEMAPHORESEXT)(GLsizei, const GLuint*); 242 | typedef GLboolean(APIENTRY* PFGLISSEMAPHOREEXT)(GLuint); 243 | typedef void(APIENTRY* PFGLIMPORTSEMAPHOREFDEXT)(GLuint, GLenum, GLint); 244 | typedef void(APIENTRY* PFGLIMPORTSEMAPHOREWIN32NAMEEXT)(GLuint, GLenum, 245 | const void*); 246 | typedef void(APIENTRY* PFGLACTIVESHADERPROGRAMEXT)(GLuint, GLuint); 247 | typedef void(APIENTRY* PFGLBINDPROGRAMPIPELINEEXT)(GLuint); 248 | typedef void(APIENTRY* PFGLDELETEPROGRAMPIPELINESEXT)(GLsizei, const GLuint*); 249 | typedef void(APIENTRY* PFGLGENPROGRAMPIPELINESEXT)(GLsizei, GLuint*); 250 | typedef GLboolean(APIENTRY* PFGLISPROGRAMPIPELINEEXT)(GLuint); 251 | typedef void(APIENTRY* PFGLPROGRAMPARAMETERIEXT)(GLuint, GLenum, GLint); 252 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM1FEXT)(GLuint, GLint, GLfloat); 253 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM1FVEXT)(GLuint, GLint, GLsizei, 254 | const GLfloat*); 255 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM1IEXT)(GLuint, GLint, GLint); 256 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM1IVEXT)(GLuint, GLint, GLsizei, 257 | const GLint*); 258 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM2FEXT)(GLuint, GLint, GLfloat, 259 | GLfloat); 260 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM2FVEXT)(GLuint, GLint, GLsizei, 261 | const GLfloat*); 262 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM2IEXT)(GLuint, GLint, GLint, GLint); 263 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM2IVEXT)(GLuint, GLint, GLsizei, 264 | const GLint*); 265 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM3FEXT)(GLuint, GLint, GLfloat, GLfloat, 266 | GLfloat); 267 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM3FVEXT)(GLuint, GLint, GLsizei, 268 | const GLfloat*); 269 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM3IEXT)(GLuint, GLint, GLint, GLint, 270 | GLint); 271 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM3IVEXT)(GLuint, GLint, GLsizei, 272 | const GLint*); 273 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM4FEXT)(GLuint, GLint, GLfloat, GLfloat, 274 | GLfloat, GLfloat); 275 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM4FVEXT)(GLuint, GLint, GLsizei, 276 | const GLfloat*); 277 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM4IEXT)(GLuint, GLint, GLint, GLint, 278 | GLint, GLint); 279 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM4IVEXT)(GLuint, GLint, GLsizei, 280 | const GLint*); 281 | typedef void(APIENTRY* PFGLPROGRAMUNIFORMMATRIX2FVEXT)(GLuint, GLint, GLsizei, 282 | GLboolean, 283 | const GLfloat*); 284 | typedef void(APIENTRY* PFGLPROGRAMUNIFORMMATRIX3FVEXT)(GLuint, GLint, GLsizei, 285 | GLboolean, 286 | const GLfloat*); 287 | typedef void(APIENTRY* PFGLPROGRAMUNIFORMMATRIX4FVEXT)(GLuint, GLint, GLsizei, 288 | GLboolean, 289 | const GLfloat*); 290 | typedef void(APIENTRY* PFGLUSEPROGRAMSTAGESEXT)(GLuint, GLbitfield, GLuint); 291 | typedef void(APIENTRY* PFGLVALIDATEPROGRAMPIPELINEEXT)(GLuint); 292 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM1UIEXT)(GLuint, GLint, GLuint); 293 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM2UIEXT)(GLuint, GLint, GLuint, GLuint); 294 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM3UIEXT)(GLuint, GLint, GLuint, GLuint, 295 | GLuint); 296 | typedef void(APIENTRY* PFGLPROGRAMUNIFORM4UIEXT)(GLuint, GLint, GLuint, GLuint, 297 | GLuint, GLuint); 298 | typedef void(APIENTRY* PFGLPROGRAMUNIFORMMATRIX2X3FVEXT)(GLuint, GLint, GLsizei, 299 | GLboolean, 300 | const GLfloat*); 301 | typedef void(APIENTRY* PFGLPROGRAMUNIFORMMATRIX3X2FVEXT)(GLuint, GLint, GLsizei, 302 | GLboolean, 303 | const GLfloat*); 304 | typedef void(APIENTRY* PFGLPROGRAMUNIFORMMATRIX2X4FVEXT)(GLuint, GLint, GLsizei, 305 | GLboolean, 306 | const GLfloat*); 307 | typedef void(APIENTRY* PFGLPROGRAMUNIFORMMATRIX4X2FVEXT)(GLuint, GLint, GLsizei, 308 | GLboolean, 309 | const GLfloat*); 310 | typedef void(APIENTRY* PFGLPROGRAMUNIFORMMATRIX3X4FVEXT)(GLuint, GLint, GLsizei, 311 | GLboolean, 312 | const GLfloat*); 313 | typedef void(APIENTRY* PFGLPROGRAMUNIFORMMATRIX4X3FVEXT)(GLuint, GLint, GLsizei, 314 | GLboolean, 315 | const GLfloat*); 316 | typedef void(APIENTRY* PFGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXT)(GLuint, 317 | GLsizei); 318 | typedef GLsizei(APIENTRY* PFGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXT)(GLuint); 319 | typedef void(APIENTRY* PFGLTEXPAGECOMMITMENTEXT)(GLenum, GLint, GLint, GLint, 320 | GLint, GLsizei, GLsizei, 321 | GLsizei, GLboolean); 322 | typedef void(APIENTRY* PFGLPATCHPARAMETERIEXT)(GLenum, GLint); 323 | typedef void(APIENTRY* PFGLTEXBUFFEREXT)(GLenum, GLenum, GLuint); 324 | typedef void(APIENTRY* PFGLTEXBUFFERRANGEEXT)(GLenum, GLenum, GLuint, GLintptr, 325 | GLsizeiptr); 326 | typedef void(APIENTRY* PFGLTEXSTORAGE1DEXT)(GLenum, GLsizei, GLenum, GLsizei); 327 | typedef void(APIENTRY* PFGLTEXSTORAGE2DEXT)(GLenum, GLsizei, GLenum, GLsizei, 328 | GLsizei); 329 | typedef void(APIENTRY* PFGLTEXSTORAGE3DEXT)(GLenum, GLsizei, GLenum, GLsizei, 330 | GLsizei, GLsizei); 331 | typedef void(APIENTRY* PFGLTEXTURESTORAGE1DEXT)(GLuint, GLenum, GLsizei, GLenum, 332 | GLsizei); 333 | typedef void(APIENTRY* PFGLTEXTURESTORAGE2DEXT)(GLuint, GLenum, GLsizei, GLenum, 334 | GLsizei, GLsizei); 335 | typedef void(APIENTRY* PFGLTEXTURESTORAGE3DEXT)(GLuint, GLenum, GLsizei, GLenum, 336 | GLsizei, GLsizei, GLsizei); 337 | typedef void(APIENTRY* PFGLTEXTUREVIEWEXT)(GLuint, GLenum, GLuint, GLenum, 338 | GLuint, GLuint, GLuint, GLuint); 339 | typedef void(APIENTRY* PFGLFRAMEBUFFERTEXTURE2DDOWNSAMPLEIMG)(GLenum, GLenum, 340 | GLenum, GLuint, 341 | GLint, GLint, 342 | GLint); 343 | typedef void(APIENTRY* PFGLFRAMEBUFFERTEXTURELAYERDOWNSAMPLEIMG)(GLenum, GLenum, 344 | GLuint, GLint, 345 | GLint, GLint, 346 | GLint); 347 | typedef void(APIENTRY* PFGLRENDERBUFFERSTORAGEMULTISAMPLEIMG)(GLenum, GLsizei, 348 | GLenum, GLsizei, 349 | GLsizei); 350 | typedef void(APIENTRY* PFGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG)(GLenum, GLenum, 351 | GLenum, GLuint, 352 | GLint, GLsizei); 353 | typedef void(APIENTRY* PFGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTEL)(); 354 | typedef void(APIENTRY* PFGLBEGINPERFQUERYINTEL)(GLuint); 355 | typedef void(APIENTRY* PFGLDELETEPERFQUERYINTEL)(GLuint); 356 | typedef void(APIENTRY* PFGLENDPERFQUERYINTEL)(GLuint); 357 | typedef void(APIENTRY* PFGLBLENDPARAMETERINV)(GLenum, GLint); 358 | typedef void(APIENTRY* PFGLBLENDBARRIERNV)(); 359 | typedef void(APIENTRY* PFGLBEGINCONDITIONALRENDERNV)(GLuint, GLenum); 360 | typedef void(APIENTRY* PFGLENDCONDITIONALRENDERNV)(); 361 | typedef void(APIENTRY* PFGLSUBPIXELPRECISIONBIASNV)(GLuint, GLuint); 362 | typedef void(APIENTRY* PFGLCONSERVATIVERASTERPARAMETERINV)(GLenum, GLint); 363 | typedef void(APIENTRY* PFGLCOPYBUFFERSUBDATANV)(GLenum, GLenum, GLintptr, 364 | GLintptr, GLsizeiptr); 365 | typedef void(APIENTRY* PFGLCOVERAGEMASKNV)(GLboolean); 366 | typedef void(APIENTRY* PFGLCOVERAGEOPERATIONNV)(GLenum); 367 | typedef void(APIENTRY* PFGLDRAWARRAYSINSTANCEDNV)(GLenum, GLint, GLsizei, 368 | GLsizei); 369 | typedef void(APIENTRY* PFGLDRAWELEMENTSINSTANCEDNV)(GLenum, GLsizei, GLenum, 370 | const void*, GLsizei); 371 | typedef void(APIENTRY* PFGLDELETEFENCESNV)(GLsizei, const GLuint*); 372 | typedef void(APIENTRY* PFGLGENFENCESNV)(GLsizei, GLuint*); 373 | typedef GLboolean(APIENTRY* PFGLISFENCENV)(GLuint); 374 | typedef GLboolean(APIENTRY* PFGLTESTFENCENV)(GLuint); 375 | typedef void(APIENTRY* PFGLFINISHFENCENV)(GLuint); 376 | typedef void(APIENTRY* PFGLSETFENCENV)(GLuint, GLenum); 377 | typedef void(APIENTRY* PFGLFRAGMENTCOVERAGECOLORNV)(GLuint); 378 | typedef void(APIENTRY* PFGLBLITFRAMEBUFFERNV)(GLint, GLint, GLint, GLint, GLint, 379 | GLint, GLint, GLint, GLbitfield, 380 | GLenum); 381 | typedef void(APIENTRY* PFGLCOVERAGEMODULATIONTABLENV)(GLsizei, const GLfloat*); 382 | typedef void(APIENTRY* PFGLCOVERAGEMODULATIONNV)(GLenum); 383 | typedef void(APIENTRY* PFGLRENDERBUFFERSTORAGEMULTISAMPLENV)(GLenum, GLsizei, 384 | GLenum, GLsizei, 385 | GLsizei); 386 | typedef void(APIENTRY* PFGLVERTEXATTRIBDIVISORNV)(GLuint, GLuint); 387 | typedef void(APIENTRY* PFGLUNIFORMMATRIX2X3FVNV)(GLint, GLsizei, GLboolean, 388 | const GLfloat*); 389 | typedef void(APIENTRY* PFGLUNIFORMMATRIX3X2FVNV)(GLint, GLsizei, GLboolean, 390 | const GLfloat*); 391 | typedef void(APIENTRY* PFGLUNIFORMMATRIX2X4FVNV)(GLint, GLsizei, GLboolean, 392 | const GLfloat*); 393 | typedef void(APIENTRY* PFGLUNIFORMMATRIX4X2FVNV)(GLint, GLsizei, GLboolean, 394 | const GLfloat*); 395 | typedef void(APIENTRY* PFGLUNIFORMMATRIX3X4FVNV)(GLint, GLsizei, GLboolean, 396 | const GLfloat*); 397 | typedef void(APIENTRY* PFGLUNIFORMMATRIX4X3FVNV)(GLint, GLsizei, GLboolean, 398 | const GLfloat*); 399 | typedef GLuint(APIENTRY* PFGLGENPATHSNV)(GLsizei); 400 | typedef void(APIENTRY* PFGLDELETEPATHSNV)(GLuint, GLsizei); 401 | typedef GLboolean(APIENTRY* PFGLISPATHNV)(GLuint); 402 | typedef void(APIENTRY* PFGLPATHCOORDSNV)(GLuint, GLsizei, GLenum, const void*); 403 | typedef void(APIENTRY* PFGLPATHSUBCOMMANDSNV)(GLuint, GLsizei, GLsizei, GLsizei, 404 | const GLubyte*, GLsizei, GLenum, 405 | const void*); 406 | typedef void(APIENTRY* PFGLPATHSUBCOORDSNV)(GLuint, GLsizei, GLsizei, GLenum, 407 | const void*); 408 | typedef void(APIENTRY* PFGLPATHSTRINGNV)(GLuint, GLenum, GLsizei, const void*); 409 | typedef void(APIENTRY* PFGLPATHGLYPHSNV)(GLuint, GLenum, const void*, 410 | GLbitfield, GLsizei, GLenum, 411 | const void*, GLenum, GLuint, GLfloat); 412 | typedef void(APIENTRY* PFGLPATHGLYPHRANGENV)(GLuint, GLenum, const void*, 413 | GLbitfield, GLuint, GLsizei, 414 | GLenum, GLuint, GLfloat); 415 | typedef void(APIENTRY* PFGLCOPYPATHNV)(GLuint, GLuint); 416 | typedef void(APIENTRY* PFGLINTERPOLATEPATHSNV)(GLuint, GLuint, GLuint, GLfloat); 417 | typedef void(APIENTRY* PFGLPATHPARAMETERIVNV)(GLuint, GLenum, const GLint*); 418 | typedef void(APIENTRY* PFGLPATHPARAMETERINV)(GLuint, GLenum, GLint); 419 | typedef void(APIENTRY* PFGLPATHPARAMETERFVNV)(GLuint, GLenum, const GLfloat*); 420 | typedef void(APIENTRY* PFGLPATHPARAMETERFNV)(GLuint, GLenum, GLfloat); 421 | typedef void(APIENTRY* PFGLPATHSTENCILFUNCNV)(GLenum, GLint, GLuint); 422 | typedef void(APIENTRY* PFGLPATHSTENCILDEPTHOFFSETNV)(GLfloat, GLfloat); 423 | typedef void(APIENTRY* PFGLSTENCILFILLPATHNV)(GLuint, GLenum, GLuint); 424 | typedef void(APIENTRY* PFGLSTENCILSTROKEPATHNV)(GLuint, GLint, GLuint); 425 | typedef void(APIENTRY* PFGLPATHCOVERDEPTHFUNCNV)(GLenum); 426 | typedef void(APIENTRY* PFGLCOVERFILLPATHNV)(GLuint, GLenum); 427 | typedef void(APIENTRY* PFGLCOVERSTROKEPATHNV)(GLuint, GLenum); 428 | typedef GLboolean(APIENTRY* PFGLISPOINTINFILLPATHNV)(GLuint, GLuint, GLfloat, 429 | GLfloat); 430 | typedef GLboolean(APIENTRY* PFGLISPOINTINSTROKEPATHNV)(GLuint, GLfloat, 431 | GLfloat); 432 | typedef GLfloat(APIENTRY* PFGLGETPATHLENGTHNV)(GLuint, GLsizei, GLsizei); 433 | typedef void(APIENTRY* PFGLSTENCILTHENCOVERFILLPATHNV)(GLuint, GLenum, GLuint, 434 | GLenum); 435 | typedef void(APIENTRY* PFGLSTENCILTHENCOVERSTROKEPATHNV)(GLuint, GLint, GLuint, 436 | GLenum); 437 | typedef GLenum(APIENTRY* PFGLPATHGLYPHINDEXARRAYNV)(GLuint, GLenum, const void*, 438 | GLbitfield, GLuint, GLsizei, 439 | GLuint, GLfloat); 440 | typedef GLenum(APIENTRY* PFGLPATHMEMORYGLYPHINDEXARRAYNV)(GLuint, GLenum, 441 | GLsizeiptr, 442 | const void*, GLsizei, 443 | GLuint, GLsizei, 444 | GLuint, GLfloat); 445 | typedef void(APIENTRY* PFGLPOLYGONMODENV)(GLenum, GLenum); 446 | typedef void(APIENTRY* PFGLREADBUFFERNV)(GLenum); 447 | typedef void(APIENTRY* PFGLFRAMEBUFFERSAMPLELOCATIONSFVNV)(GLenum, GLuint, 448 | GLsizei, 449 | const GLfloat*); 450 | typedef void(APIENTRY* PFGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNV)(GLuint, GLuint, 451 | GLsizei, 452 | const GLfloat*); 453 | typedef void(APIENTRY* PFGLRESOLVEDEPTHVALUESNV)(); 454 | typedef void(APIENTRY* PFGLVIEWPORTARRAYVNV)(GLuint, GLsizei, const GLfloat*); 455 | typedef void(APIENTRY* PFGLVIEWPORTINDEXEDFNV)(GLuint, GLfloat, GLfloat, 456 | GLfloat, GLfloat); 457 | typedef void(APIENTRY* PFGLVIEWPORTINDEXEDFVNV)(GLuint, const GLfloat*); 458 | typedef void(APIENTRY* PFGLSCISSORARRAYVNV)(GLuint, GLsizei, const GLint*); 459 | typedef void(APIENTRY* PFGLSCISSORINDEXEDNV)(GLuint, GLint, GLint, GLsizei, 460 | GLsizei); 461 | typedef void(APIENTRY* PFGLSCISSORINDEXEDVNV)(GLuint, const GLint*); 462 | typedef void(APIENTRY* PFGLDEPTHRANGEARRAYFVNV)(GLuint, GLsizei, 463 | const GLfloat*); 464 | typedef void(APIENTRY* PFGLDEPTHRANGEINDEXEDFNV)(GLuint, GLfloat, GLfloat); 465 | typedef void(APIENTRY* PFGLENABLEINV)(GLenum, GLuint); 466 | typedef void(APIENTRY* PFGLDISABLEINV)(GLenum, GLuint); 467 | typedef GLboolean(APIENTRY* PFGLISENABLEDINV)(GLenum, GLuint); 468 | typedef void(APIENTRY* PFGLVIEWPORTSWIZZLENV)(GLuint, GLenum, GLenum, GLenum, 469 | GLenum); 470 | typedef void(APIENTRY* PFGLFRAMEBUFFERTEXTUREMULTIVIEWOVR)(GLenum, GLenum, 471 | GLuint, GLint, GLint, 472 | GLsizei); 473 | typedef void(APIENTRY* PFGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVR)( 474 | GLenum, GLenum, GLuint, GLint, GLsizei, GLint, GLsizei); 475 | typedef void(APIENTRY* PFGLALPHAFUNCQCOM)(GLenum, GLclampf); 476 | typedef void(APIENTRY* PFGLENABLEDRIVERCONTROLQCOM)(GLuint); 477 | typedef void(APIENTRY* PFGLDISABLEDRIVERCONTROLQCOM)(GLuint); 478 | typedef void(APIENTRY* PFGLEXTTEXOBJECTSTATEOVERRIDEIQCOM)(GLenum, GLenum, 479 | GLint); 480 | typedef GLboolean(APIENTRY* PFGLEXTISPROGRAMBINARYQCOM)(GLuint); 481 | typedef void(APIENTRY* PFGLFRAMEBUFFERFOVEATIONPARAMETERSQCOM)( 482 | GLuint, GLuint, GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); 483 | typedef void(APIENTRY* PFGLFRAMEBUFFERFETCHBARRIERQCOM)(); 484 | typedef void(APIENTRY* PFGLSTARTTILINGQCOM)(GLuint, GLuint, GLuint, GLuint, 485 | GLbitfield); 486 | typedef void(APIENTRY* PFGLENDTILINGQCOM)(GLbitfield); 487 | 488 | struct DynamicFunctions { 489 | void* handle; 490 | PFGLBLENDBARRIERKHR glBlendBarrierKHR; 491 | PFGLDEBUGMESSAGEINSERTKHR glDebugMessageInsertKHR; 492 | PFGLPUSHDEBUGGROUPKHR glPushDebugGroupKHR; 493 | PFGLPOPDEBUGGROUPKHR glPopDebugGroupKHR; 494 | PFGLOBJECTLABELKHR glObjectLabelKHR; 495 | PFGLOBJECTPTRLABELKHR glObjectPtrLabelKHR; 496 | PFGLGETGRAPHICSRESETSTATUSKHR glGetGraphicsResetStatusKHR; 497 | PFGLCOPYIMAGESUBDATAOES glCopyImageSubDataOES; 498 | PFGLENABLEIOES glEnableiOES; 499 | PFGLDISABLEIOES glDisableiOES; 500 | PFGLBLENDEQUATIONIOES glBlendEquationiOES; 501 | PFGLBLENDEQUATIONSEPARATEIOES glBlendEquationSeparateiOES; 502 | PFGLBLENDFUNCIOES glBlendFunciOES; 503 | PFGLBLENDFUNCSEPARATEIOES glBlendFuncSeparateiOES; 504 | PFGLCOLORMASKIOES glColorMaskiOES; 505 | PFGLISENABLEDIOES glIsEnablediOES; 506 | PFGLDRAWELEMENTSBASEVERTEXOES glDrawElementsBaseVertexOES; 507 | PFGLDRAWRANGEELEMENTSBASEVERTEXOES glDrawRangeElementsBaseVertexOES; 508 | PFGLDRAWELEMENTSINSTANCEDBASEVERTEXOES glDrawElementsInstancedBaseVertexOES; 509 | PFGLFRAMEBUFFERTEXTUREOES glFramebufferTextureOES; 510 | PFGLPROGRAMBINARYOES glProgramBinaryOES; 511 | PFGLUNMAPBUFFEROES glUnmapBufferOES; 512 | PFGLPRIMITIVEBOUNDINGBOXOES glPrimitiveBoundingBoxOES; 513 | PFGLMINSAMPLESHADINGOES glMinSampleShadingOES; 514 | PFGLPATCHPARAMETERIOES glPatchParameteriOES; 515 | PFGLTEXIMAGE3DOES glTexImage3DOES; 516 | PFGLTEXSUBIMAGE3DOES glTexSubImage3DOES; 517 | PFGLCOPYTEXSUBIMAGE3DOES glCopyTexSubImage3DOES; 518 | PFGLCOMPRESSEDTEXIMAGE3DOES glCompressedTexImage3DOES; 519 | PFGLCOMPRESSEDTEXSUBIMAGE3DOES glCompressedTexSubImage3DOES; 520 | PFGLFRAMEBUFFERTEXTURE3DOES glFramebufferTexture3DOES; 521 | PFGLTEXBUFFEROES glTexBufferOES; 522 | PFGLTEXBUFFERRANGEOES glTexBufferRangeOES; 523 | PFGLTEXSTORAGE3DMULTISAMPLEOES glTexStorage3DMultisampleOES; 524 | PFGLTEXTUREVIEWOES glTextureViewOES; 525 | PFGLBINDVERTEXARRAYOES glBindVertexArrayOES; 526 | PFGLDELETEVERTEXARRAYSOES glDeleteVertexArraysOES; 527 | PFGLGENVERTEXARRAYSOES glGenVertexArraysOES; 528 | PFGLISVERTEXARRAYOES glIsVertexArrayOES; 529 | PFGLVIEWPORTARRAYVOES glViewportArrayvOES; 530 | PFGLVIEWPORTINDEXEDFOES glViewportIndexedfOES; 531 | PFGLVIEWPORTINDEXEDFVOES glViewportIndexedfvOES; 532 | PFGLSCISSORARRAYVOES glScissorArrayvOES; 533 | PFGLSCISSORINDEXEDOES glScissorIndexedOES; 534 | PFGLSCISSORINDEXEDVOES glScissorIndexedvOES; 535 | PFGLDEPTHRANGEARRAYFVOES glDepthRangeArrayfvOES; 536 | PFGLDEPTHRANGEINDEXEDFOES glDepthRangeIndexedfOES; 537 | PFGLGENPERFMONITORSAMD glGenPerfMonitorsAMD; 538 | PFGLDELETEPERFMONITORSAMD glDeletePerfMonitorsAMD; 539 | PFGLBEGINPERFMONITORAMD glBeginPerfMonitorAMD; 540 | PFGLENDPERFMONITORAMD glEndPerfMonitorAMD; 541 | PFGLBLITFRAMEBUFFERANGLE glBlitFramebufferANGLE; 542 | PFGLRENDERBUFFERSTORAGEMULTISAMPLEANGLE glRenderbufferStorageMultisampleANGLE; 543 | PFGLDRAWARRAYSINSTANCEDANGLE glDrawArraysInstancedANGLE; 544 | PFGLDRAWELEMENTSINSTANCEDANGLE glDrawElementsInstancedANGLE; 545 | PFGLVERTEXATTRIBDIVISORANGLE glVertexAttribDivisorANGLE; 546 | PFGLCOPYTEXTURELEVELSAPPLE glCopyTextureLevelsAPPLE; 547 | PFGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLE glRenderbufferStorageMultisampleAPPLE; 548 | PFGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLE glResolveMultisampleFramebufferAPPLE; 549 | PFGLDRAWARRAYSINSTANCEDBASEINSTANCEEXT glDrawArraysInstancedBaseInstanceEXT; 550 | PFGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXT 551 | glDrawElementsInstancedBaseInstanceEXT; 552 | PFGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXT 553 | glDrawElementsInstancedBaseVertexBaseInstanceEXT; 554 | PFGLBINDFRAGDATALOCATIONINDEXEDEXT glBindFragDataLocationIndexedEXT; 555 | PFGLBINDFRAGDATALOCATIONEXT glBindFragDataLocationEXT; 556 | PFGLGETPROGRAMRESOURCELOCATIONINDEXEXT glGetProgramResourceLocationIndexEXT; 557 | PFGLGETFRAGDATAINDEXEXT glGetFragDataIndexEXT; 558 | PFGLBUFFERSTORAGEEXT glBufferStorageEXT; 559 | PFGLCLEARTEXIMAGEEXT glClearTexImageEXT; 560 | PFGLCLEARTEXSUBIMAGEEXT glClearTexSubImageEXT; 561 | PFGLCOPYIMAGESUBDATAEXT glCopyImageSubDataEXT; 562 | PFGLLABELOBJECTEXT glLabelObjectEXT; 563 | PFGLINSERTEVENTMARKEREXT glInsertEventMarkerEXT; 564 | PFGLPUSHGROUPMARKEREXT glPushGroupMarkerEXT; 565 | PFGLPOPGROUPMARKEREXT glPopGroupMarkerEXT; 566 | PFGLGENQUERIESEXT glGenQueriesEXT; 567 | PFGLDELETEQUERIESEXT glDeleteQueriesEXT; 568 | PFGLISQUERYEXT glIsQueryEXT; 569 | PFGLBEGINQUERYEXT glBeginQueryEXT; 570 | PFGLENDQUERYEXT glEndQueryEXT; 571 | PFGLQUERYCOUNTEREXT glQueryCounterEXT; 572 | PFGLENABLEIEXT glEnableiEXT; 573 | PFGLDISABLEIEXT glDisableiEXT; 574 | PFGLBLENDEQUATIONIEXT glBlendEquationiEXT; 575 | PFGLBLENDEQUATIONSEPARATEIEXT glBlendEquationSeparateiEXT; 576 | PFGLBLENDFUNCIEXT glBlendFunciEXT; 577 | PFGLBLENDFUNCSEPARATEIEXT glBlendFuncSeparateiEXT; 578 | PFGLCOLORMASKIEXT glColorMaskiEXT; 579 | PFGLISENABLEDIEXT glIsEnablediEXT; 580 | PFGLDRAWELEMENTSBASEVERTEXEXT glDrawElementsBaseVertexEXT; 581 | PFGLDRAWRANGEELEMENTSBASEVERTEXEXT glDrawRangeElementsBaseVertexEXT; 582 | PFGLDRAWELEMENTSINSTANCEDBASEVERTEXEXT glDrawElementsInstancedBaseVertexEXT; 583 | PFGLDRAWARRAYSINSTANCEDEXT glDrawArraysInstancedEXT; 584 | PFGLDRAWELEMENTSINSTANCEDEXT glDrawElementsInstancedEXT; 585 | PFGLDRAWTRANSFORMFEEDBACKEXT glDrawTransformFeedbackEXT; 586 | PFGLDRAWTRANSFORMFEEDBACKINSTANCEDEXT glDrawTransformFeedbackInstancedEXT; 587 | PFGLFRAMEBUFFERTEXTUREEXT glFramebufferTextureEXT; 588 | PFGLVERTEXATTRIBDIVISOREXT glVertexAttribDivisorEXT; 589 | PFGLFLUSHMAPPEDBUFFERRANGEEXT glFlushMappedBufferRangeEXT; 590 | PFGLDELETEMEMORYOBJECTSEXT glDeleteMemoryObjectsEXT; 591 | PFGLISMEMORYOBJECTEXT glIsMemoryObjectEXT; 592 | PFGLMULTIDRAWARRAYSINDIRECTEXT glMultiDrawArraysIndirectEXT; 593 | PFGLMULTIDRAWELEMENTSINDIRECTEXT glMultiDrawElementsIndirectEXT; 594 | PFGLRENDERBUFFERSTORAGEMULTISAMPLEEXT glRenderbufferStorageMultisampleEXT; 595 | PFGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXT glFramebufferTexture2DMultisampleEXT; 596 | PFGLREADBUFFERINDEXEDEXT glReadBufferIndexedEXT; 597 | PFGLPOLYGONOFFSETCLAMPEXT glPolygonOffsetClampEXT; 598 | PFGLPRIMITIVEBOUNDINGBOXEXT glPrimitiveBoundingBoxEXT; 599 | PFGLRASTERSAMPLESEXT glRasterSamplesEXT; 600 | PFGLGETGRAPHICSRESETSTATUSEXT glGetGraphicsResetStatusEXT; 601 | PFGLGENSEMAPHORESEXT glGenSemaphoresEXT; 602 | PFGLDELETESEMAPHORESEXT glDeleteSemaphoresEXT; 603 | PFGLISSEMAPHOREEXT glIsSemaphoreEXT; 604 | PFGLIMPORTSEMAPHOREFDEXT glImportSemaphoreFdEXT; 605 | PFGLIMPORTSEMAPHOREWIN32NAMEEXT glImportSemaphoreWin32NameEXT; 606 | PFGLACTIVESHADERPROGRAMEXT glActiveShaderProgramEXT; 607 | PFGLBINDPROGRAMPIPELINEEXT glBindProgramPipelineEXT; 608 | PFGLDELETEPROGRAMPIPELINESEXT glDeleteProgramPipelinesEXT; 609 | PFGLGENPROGRAMPIPELINESEXT glGenProgramPipelinesEXT; 610 | PFGLISPROGRAMPIPELINEEXT glIsProgramPipelineEXT; 611 | PFGLPROGRAMPARAMETERIEXT glProgramParameteriEXT; 612 | PFGLPROGRAMUNIFORM1FEXT glProgramUniform1fEXT; 613 | PFGLPROGRAMUNIFORM1FVEXT glProgramUniform1fvEXT; 614 | PFGLPROGRAMUNIFORM1IEXT glProgramUniform1iEXT; 615 | PFGLPROGRAMUNIFORM1IVEXT glProgramUniform1ivEXT; 616 | PFGLPROGRAMUNIFORM2FEXT glProgramUniform2fEXT; 617 | PFGLPROGRAMUNIFORM2FVEXT glProgramUniform2fvEXT; 618 | PFGLPROGRAMUNIFORM2IEXT glProgramUniform2iEXT; 619 | PFGLPROGRAMUNIFORM2IVEXT glProgramUniform2ivEXT; 620 | PFGLPROGRAMUNIFORM3FEXT glProgramUniform3fEXT; 621 | PFGLPROGRAMUNIFORM3FVEXT glProgramUniform3fvEXT; 622 | PFGLPROGRAMUNIFORM3IEXT glProgramUniform3iEXT; 623 | PFGLPROGRAMUNIFORM3IVEXT glProgramUniform3ivEXT; 624 | PFGLPROGRAMUNIFORM4FEXT glProgramUniform4fEXT; 625 | PFGLPROGRAMUNIFORM4FVEXT glProgramUniform4fvEXT; 626 | PFGLPROGRAMUNIFORM4IEXT glProgramUniform4iEXT; 627 | PFGLPROGRAMUNIFORM4IVEXT glProgramUniform4ivEXT; 628 | PFGLPROGRAMUNIFORMMATRIX2FVEXT glProgramUniformMatrix2fvEXT; 629 | PFGLPROGRAMUNIFORMMATRIX3FVEXT glProgramUniformMatrix3fvEXT; 630 | PFGLPROGRAMUNIFORMMATRIX4FVEXT glProgramUniformMatrix4fvEXT; 631 | PFGLUSEPROGRAMSTAGESEXT glUseProgramStagesEXT; 632 | PFGLVALIDATEPROGRAMPIPELINEEXT glValidateProgramPipelineEXT; 633 | PFGLPROGRAMUNIFORM1UIEXT glProgramUniform1uiEXT; 634 | PFGLPROGRAMUNIFORM2UIEXT glProgramUniform2uiEXT; 635 | PFGLPROGRAMUNIFORM3UIEXT glProgramUniform3uiEXT; 636 | PFGLPROGRAMUNIFORM4UIEXT glProgramUniform4uiEXT; 637 | PFGLPROGRAMUNIFORMMATRIX2X3FVEXT glProgramUniformMatrix2x3fvEXT; 638 | PFGLPROGRAMUNIFORMMATRIX3X2FVEXT glProgramUniformMatrix3x2fvEXT; 639 | PFGLPROGRAMUNIFORMMATRIX2X4FVEXT glProgramUniformMatrix2x4fvEXT; 640 | PFGLPROGRAMUNIFORMMATRIX4X2FVEXT glProgramUniformMatrix4x2fvEXT; 641 | PFGLPROGRAMUNIFORMMATRIX3X4FVEXT glProgramUniformMatrix3x4fvEXT; 642 | PFGLPROGRAMUNIFORMMATRIX4X3FVEXT glProgramUniformMatrix4x3fvEXT; 643 | PFGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXT glFramebufferPixelLocalStorageSizeEXT; 644 | PFGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXT 645 | glGetFramebufferPixelLocalStorageSizeEXT; 646 | PFGLTEXPAGECOMMITMENTEXT glTexPageCommitmentEXT; 647 | PFGLPATCHPARAMETERIEXT glPatchParameteriEXT; 648 | PFGLTEXBUFFEREXT glTexBufferEXT; 649 | PFGLTEXBUFFERRANGEEXT glTexBufferRangeEXT; 650 | PFGLTEXSTORAGE1DEXT glTexStorage1DEXT; 651 | PFGLTEXSTORAGE2DEXT glTexStorage2DEXT; 652 | PFGLTEXSTORAGE3DEXT glTexStorage3DEXT; 653 | PFGLTEXTURESTORAGE1DEXT glTextureStorage1DEXT; 654 | PFGLTEXTURESTORAGE2DEXT glTextureStorage2DEXT; 655 | PFGLTEXTURESTORAGE3DEXT glTextureStorage3DEXT; 656 | PFGLTEXTUREVIEWEXT glTextureViewEXT; 657 | PFGLFRAMEBUFFERTEXTURE2DDOWNSAMPLEIMG glFramebufferTexture2DDownsampleIMG; 658 | PFGLFRAMEBUFFERTEXTURELAYERDOWNSAMPLEIMG 659 | glFramebufferTextureLayerDownsampleIMG; 660 | PFGLRENDERBUFFERSTORAGEMULTISAMPLEIMG glRenderbufferStorageMultisampleIMG; 661 | PFGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG glFramebufferTexture2DMultisampleIMG; 662 | PFGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTEL glApplyFramebufferAttachmentCMAAINTEL; 663 | PFGLBEGINPERFQUERYINTEL glBeginPerfQueryINTEL; 664 | PFGLDELETEPERFQUERYINTEL glDeletePerfQueryINTEL; 665 | PFGLENDPERFQUERYINTEL glEndPerfQueryINTEL; 666 | PFGLBLENDPARAMETERINV glBlendParameteriNV; 667 | PFGLBLENDBARRIERNV glBlendBarrierNV; 668 | PFGLBEGINCONDITIONALRENDERNV glBeginConditionalRenderNV; 669 | PFGLENDCONDITIONALRENDERNV glEndConditionalRenderNV; 670 | PFGLSUBPIXELPRECISIONBIASNV glSubpixelPrecisionBiasNV; 671 | PFGLCONSERVATIVERASTERPARAMETERINV glConservativeRasterParameteriNV; 672 | PFGLCOPYBUFFERSUBDATANV glCopyBufferSubDataNV; 673 | PFGLCOVERAGEMASKNV glCoverageMaskNV; 674 | PFGLCOVERAGEOPERATIONNV glCoverageOperationNV; 675 | PFGLDRAWARRAYSINSTANCEDNV glDrawArraysInstancedNV; 676 | PFGLDRAWELEMENTSINSTANCEDNV glDrawElementsInstancedNV; 677 | PFGLDELETEFENCESNV glDeleteFencesNV; 678 | PFGLGENFENCESNV glGenFencesNV; 679 | PFGLISFENCENV glIsFenceNV; 680 | PFGLTESTFENCENV glTestFenceNV; 681 | PFGLFINISHFENCENV glFinishFenceNV; 682 | PFGLSETFENCENV glSetFenceNV; 683 | PFGLFRAGMENTCOVERAGECOLORNV glFragmentCoverageColorNV; 684 | PFGLBLITFRAMEBUFFERNV glBlitFramebufferNV; 685 | PFGLCOVERAGEMODULATIONTABLENV glCoverageModulationTableNV; 686 | PFGLCOVERAGEMODULATIONNV glCoverageModulationNV; 687 | PFGLRENDERBUFFERSTORAGEMULTISAMPLENV glRenderbufferStorageMultisampleNV; 688 | PFGLVERTEXATTRIBDIVISORNV glVertexAttribDivisorNV; 689 | PFGLUNIFORMMATRIX2X3FVNV glUniformMatrix2x3fvNV; 690 | PFGLUNIFORMMATRIX3X2FVNV glUniformMatrix3x2fvNV; 691 | PFGLUNIFORMMATRIX2X4FVNV glUniformMatrix2x4fvNV; 692 | PFGLUNIFORMMATRIX4X2FVNV glUniformMatrix4x2fvNV; 693 | PFGLUNIFORMMATRIX3X4FVNV glUniformMatrix3x4fvNV; 694 | PFGLUNIFORMMATRIX4X3FVNV glUniformMatrix4x3fvNV; 695 | PFGLGENPATHSNV glGenPathsNV; 696 | PFGLDELETEPATHSNV glDeletePathsNV; 697 | PFGLISPATHNV glIsPathNV; 698 | PFGLPATHCOORDSNV glPathCoordsNV; 699 | PFGLPATHSUBCOMMANDSNV glPathSubCommandsNV; 700 | PFGLPATHSUBCOORDSNV glPathSubCoordsNV; 701 | PFGLPATHSTRINGNV glPathStringNV; 702 | PFGLPATHGLYPHSNV glPathGlyphsNV; 703 | PFGLPATHGLYPHRANGENV glPathGlyphRangeNV; 704 | PFGLCOPYPATHNV glCopyPathNV; 705 | PFGLINTERPOLATEPATHSNV glInterpolatePathsNV; 706 | PFGLPATHPARAMETERIVNV glPathParameterivNV; 707 | PFGLPATHPARAMETERINV glPathParameteriNV; 708 | PFGLPATHPARAMETERFVNV glPathParameterfvNV; 709 | PFGLPATHPARAMETERFNV glPathParameterfNV; 710 | PFGLPATHSTENCILFUNCNV glPathStencilFuncNV; 711 | PFGLPATHSTENCILDEPTHOFFSETNV glPathStencilDepthOffsetNV; 712 | PFGLSTENCILFILLPATHNV glStencilFillPathNV; 713 | PFGLSTENCILSTROKEPATHNV glStencilStrokePathNV; 714 | PFGLPATHCOVERDEPTHFUNCNV glPathCoverDepthFuncNV; 715 | PFGLCOVERFILLPATHNV glCoverFillPathNV; 716 | PFGLCOVERSTROKEPATHNV glCoverStrokePathNV; 717 | PFGLISPOINTINFILLPATHNV glIsPointInFillPathNV; 718 | PFGLISPOINTINSTROKEPATHNV glIsPointInStrokePathNV; 719 | PFGLGETPATHLENGTHNV glGetPathLengthNV; 720 | PFGLSTENCILTHENCOVERFILLPATHNV glStencilThenCoverFillPathNV; 721 | PFGLSTENCILTHENCOVERSTROKEPATHNV glStencilThenCoverStrokePathNV; 722 | PFGLPATHGLYPHINDEXARRAYNV glPathGlyphIndexArrayNV; 723 | PFGLPATHMEMORYGLYPHINDEXARRAYNV glPathMemoryGlyphIndexArrayNV; 724 | PFGLPOLYGONMODENV glPolygonModeNV; 725 | PFGLREADBUFFERNV glReadBufferNV; 726 | PFGLFRAMEBUFFERSAMPLELOCATIONSFVNV glFramebufferSampleLocationsfvNV; 727 | PFGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNV glNamedFramebufferSampleLocationsfvNV; 728 | PFGLRESOLVEDEPTHVALUESNV glResolveDepthValuesNV; 729 | PFGLVIEWPORTARRAYVNV glViewportArrayvNV; 730 | PFGLVIEWPORTINDEXEDFNV glViewportIndexedfNV; 731 | PFGLVIEWPORTINDEXEDFVNV glViewportIndexedfvNV; 732 | PFGLSCISSORARRAYVNV glScissorArrayvNV; 733 | PFGLSCISSORINDEXEDNV glScissorIndexedNV; 734 | PFGLSCISSORINDEXEDVNV glScissorIndexedvNV; 735 | PFGLDEPTHRANGEARRAYFVNV glDepthRangeArrayfvNV; 736 | PFGLDEPTHRANGEINDEXEDFNV glDepthRangeIndexedfNV; 737 | PFGLENABLEINV glEnableiNV; 738 | PFGLDISABLEINV glDisableiNV; 739 | PFGLISENABLEDINV glIsEnablediNV; 740 | PFGLVIEWPORTSWIZZLENV glViewportSwizzleNV; 741 | PFGLFRAMEBUFFERTEXTUREMULTIVIEWOVR glFramebufferTextureMultiviewOVR; 742 | PFGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVR 743 | glFramebufferTextureMultisampleMultiviewOVR; 744 | PFGLALPHAFUNCQCOM glAlphaFuncQCOM; 745 | PFGLENABLEDRIVERCONTROLQCOM glEnableDriverControlQCOM; 746 | PFGLDISABLEDRIVERCONTROLQCOM glDisableDriverControlQCOM; 747 | PFGLEXTTEXOBJECTSTATEOVERRIDEIQCOM glExtTexObjectStateOverrideiQCOM; 748 | PFGLEXTISPROGRAMBINARYQCOM glExtIsProgramBinaryQCOM; 749 | PFGLFRAMEBUFFERFOVEATIONPARAMETERSQCOM glFramebufferFoveationParametersQCOM; 750 | PFGLFRAMEBUFFERFETCHBARRIERQCOM glFramebufferFetchBarrierQCOM; 751 | PFGLSTARTTILINGQCOM glStartTilingQCOM; 752 | PFGLENDTILINGQCOM glEndTilingQCOM; 753 | }; 754 | 755 | extern struct DynamicFunctions dll; 756 | 757 | #endif // DART_GL_LIB_SRC_GENERATED_FUNCTION_LIST_H_ 758 | -------------------------------------------------------------------------------- /lib/src/generated/gl_bindings.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | // This file is auto-generated by scripts in the tools/ directory. 7 | #ifndef DART_GL_LIB_SRC_GENERATED_GENERATED_BINDINGS_H_ 8 | #define DART_GL_LIB_SRC_GENERATED_GENERATED_BINDINGS_H_ 9 | 10 | #include "dart_api.h" 11 | 12 | // Header file for generated GL function bindings. 13 | 14 | void glActiveTexture_native(Dart_NativeArguments arguments); 15 | void glAttachShader_native(Dart_NativeArguments arguments); 16 | void glBindAttribLocation_native(Dart_NativeArguments arguments); 17 | void glBindBuffer_native(Dart_NativeArguments arguments); 18 | void glBindFramebuffer_native(Dart_NativeArguments arguments); 19 | void glBindRenderbuffer_native(Dart_NativeArguments arguments); 20 | void glBindTexture_native(Dart_NativeArguments arguments); 21 | void glBlendColor_native(Dart_NativeArguments arguments); 22 | void glBlendEquation_native(Dart_NativeArguments arguments); 23 | void glBlendEquationSeparate_native(Dart_NativeArguments arguments); 24 | void glBlendFunc_native(Dart_NativeArguments arguments); 25 | void glBlendFuncSeparate_native(Dart_NativeArguments arguments); 26 | void glBufferData_native(Dart_NativeArguments arguments); 27 | void glBufferSubData_native(Dart_NativeArguments arguments); 28 | void glCheckFramebufferStatus_native(Dart_NativeArguments arguments); 29 | void glClear_native(Dart_NativeArguments arguments); 30 | void glClearColor_native(Dart_NativeArguments arguments); 31 | void glClearDepthf_native(Dart_NativeArguments arguments); 32 | void glClearStencil_native(Dart_NativeArguments arguments); 33 | void glColorMask_native(Dart_NativeArguments arguments); 34 | void glCompileShader_native(Dart_NativeArguments arguments); 35 | void glCompressedTexImage2D_native(Dart_NativeArguments arguments); 36 | void glCompressedTexSubImage2D_native(Dart_NativeArguments arguments); 37 | void glCopyTexImage2D_native(Dart_NativeArguments arguments); 38 | void glCopyTexSubImage2D_native(Dart_NativeArguments arguments); 39 | void glCreateProgram_native(Dart_NativeArguments arguments); 40 | void glCreateShader_native(Dart_NativeArguments arguments); 41 | void glCullFace_native(Dart_NativeArguments arguments); 42 | void glDeleteBuffers_native(Dart_NativeArguments arguments); 43 | void glDeleteFramebuffers_native(Dart_NativeArguments arguments); 44 | void glDeleteProgram_native(Dart_NativeArguments arguments); 45 | void glDeleteRenderbuffers_native(Dart_NativeArguments arguments); 46 | void glDeleteShader_native(Dart_NativeArguments arguments); 47 | void glDeleteTextures_native(Dart_NativeArguments arguments); 48 | void glDepthFunc_native(Dart_NativeArguments arguments); 49 | void glDepthMask_native(Dart_NativeArguments arguments); 50 | void glDepthRangef_native(Dart_NativeArguments arguments); 51 | void glDetachShader_native(Dart_NativeArguments arguments); 52 | void glDisable_native(Dart_NativeArguments arguments); 53 | void glDisableVertexAttribArray_native(Dart_NativeArguments arguments); 54 | void glDrawArrays_native(Dart_NativeArguments arguments); 55 | void glDrawElements_native(Dart_NativeArguments arguments); 56 | void glEnable_native(Dart_NativeArguments arguments); 57 | void glEnableVertexAttribArray_native(Dart_NativeArguments arguments); 58 | void glFinish_native(Dart_NativeArguments arguments); 59 | void glFlush_native(Dart_NativeArguments arguments); 60 | void glFramebufferRenderbuffer_native(Dart_NativeArguments arguments); 61 | void glFramebufferTexture2D_native(Dart_NativeArguments arguments); 62 | void glFrontFace_native(Dart_NativeArguments arguments); 63 | void glGenBuffers_native(Dart_NativeArguments arguments); 64 | void glGenerateMipmap_native(Dart_NativeArguments arguments); 65 | void glGenFramebuffers_native(Dart_NativeArguments arguments); 66 | void glGenRenderbuffers_native(Dart_NativeArguments arguments); 67 | void glGenTextures_native(Dart_NativeArguments arguments); 68 | void glGetAttribLocation_native(Dart_NativeArguments arguments); 69 | void glGetError_native(Dart_NativeArguments arguments); 70 | void glGetString_native(Dart_NativeArguments arguments); 71 | void glGetUniformLocation_native(Dart_NativeArguments arguments); 72 | void glHint_native(Dart_NativeArguments arguments); 73 | void glIsBuffer_native(Dart_NativeArguments arguments); 74 | void glIsEnabled_native(Dart_NativeArguments arguments); 75 | void glIsFramebuffer_native(Dart_NativeArguments arguments); 76 | void glIsProgram_native(Dart_NativeArguments arguments); 77 | void glIsRenderbuffer_native(Dart_NativeArguments arguments); 78 | void glIsShader_native(Dart_NativeArguments arguments); 79 | void glIsTexture_native(Dart_NativeArguments arguments); 80 | void glLineWidth_native(Dart_NativeArguments arguments); 81 | void glLinkProgram_native(Dart_NativeArguments arguments); 82 | void glPixelStorei_native(Dart_NativeArguments arguments); 83 | void glPolygonOffset_native(Dart_NativeArguments arguments); 84 | void glReleaseShaderCompiler_native(Dart_NativeArguments arguments); 85 | void glRenderbufferStorage_native(Dart_NativeArguments arguments); 86 | void glSampleCoverage_native(Dart_NativeArguments arguments); 87 | void glScissor_native(Dart_NativeArguments arguments); 88 | void glStencilFunc_native(Dart_NativeArguments arguments); 89 | void glStencilFuncSeparate_native(Dart_NativeArguments arguments); 90 | void glStencilMask_native(Dart_NativeArguments arguments); 91 | void glStencilMaskSeparate_native(Dart_NativeArguments arguments); 92 | void glStencilOp_native(Dart_NativeArguments arguments); 93 | void glStencilOpSeparate_native(Dart_NativeArguments arguments); 94 | void glTexImage2D_native(Dart_NativeArguments arguments); 95 | void glTexParameterf_native(Dart_NativeArguments arguments); 96 | void glTexParameteri_native(Dart_NativeArguments arguments); 97 | void glTexSubImage2D_native(Dart_NativeArguments arguments); 98 | void glUniform1f_native(Dart_NativeArguments arguments); 99 | void glUniform1fv_native(Dart_NativeArguments arguments); 100 | void glUniform1i_native(Dart_NativeArguments arguments); 101 | void glUniform1iv_native(Dart_NativeArguments arguments); 102 | void glUniform2f_native(Dart_NativeArguments arguments); 103 | void glUniform2fv_native(Dart_NativeArguments arguments); 104 | void glUniform2i_native(Dart_NativeArguments arguments); 105 | void glUniform2iv_native(Dart_NativeArguments arguments); 106 | void glUniform3f_native(Dart_NativeArguments arguments); 107 | void glUniform3fv_native(Dart_NativeArguments arguments); 108 | void glUniform3i_native(Dart_NativeArguments arguments); 109 | void glUniform3iv_native(Dart_NativeArguments arguments); 110 | void glUniform4f_native(Dart_NativeArguments arguments); 111 | void glUniform4fv_native(Dart_NativeArguments arguments); 112 | void glUniform4i_native(Dart_NativeArguments arguments); 113 | void glUniform4iv_native(Dart_NativeArguments arguments); 114 | void glUniformMatrix2fv_native(Dart_NativeArguments arguments); 115 | void glUniformMatrix3fv_native(Dart_NativeArguments arguments); 116 | void glUniformMatrix4fv_native(Dart_NativeArguments arguments); 117 | void glUseProgram_native(Dart_NativeArguments arguments); 118 | void glValidateProgram_native(Dart_NativeArguments arguments); 119 | void glVertexAttrib1f_native(Dart_NativeArguments arguments); 120 | void glVertexAttrib1fv_native(Dart_NativeArguments arguments); 121 | void glVertexAttrib2f_native(Dart_NativeArguments arguments); 122 | void glVertexAttrib2fv_native(Dart_NativeArguments arguments); 123 | void glVertexAttrib3f_native(Dart_NativeArguments arguments); 124 | void glVertexAttrib3fv_native(Dart_NativeArguments arguments); 125 | void glVertexAttrib4f_native(Dart_NativeArguments arguments); 126 | void glVertexAttrib4fv_native(Dart_NativeArguments arguments); 127 | void glViewport_native(Dart_NativeArguments arguments); 128 | void glBlendBarrierKHR_native(Dart_NativeArguments arguments); 129 | void glDebugMessageInsertKHR_native(Dart_NativeArguments arguments); 130 | void glPushDebugGroupKHR_native(Dart_NativeArguments arguments); 131 | void glPopDebugGroupKHR_native(Dart_NativeArguments arguments); 132 | void glObjectLabelKHR_native(Dart_NativeArguments arguments); 133 | void glObjectPtrLabelKHR_native(Dart_NativeArguments arguments); 134 | void glGetGraphicsResetStatusKHR_native(Dart_NativeArguments arguments); 135 | void glCopyImageSubDataOES_native(Dart_NativeArguments arguments); 136 | void glEnableiOES_native(Dart_NativeArguments arguments); 137 | void glDisableiOES_native(Dart_NativeArguments arguments); 138 | void glBlendEquationiOES_native(Dart_NativeArguments arguments); 139 | void glBlendEquationSeparateiOES_native(Dart_NativeArguments arguments); 140 | void glBlendFunciOES_native(Dart_NativeArguments arguments); 141 | void glBlendFuncSeparateiOES_native(Dart_NativeArguments arguments); 142 | void glColorMaskiOES_native(Dart_NativeArguments arguments); 143 | void glIsEnablediOES_native(Dart_NativeArguments arguments); 144 | void glDrawElementsBaseVertexOES_native(Dart_NativeArguments arguments); 145 | void glDrawRangeElementsBaseVertexOES_native(Dart_NativeArguments arguments); 146 | void glDrawElementsInstancedBaseVertexOES_native( 147 | Dart_NativeArguments arguments); 148 | void glFramebufferTextureOES_native(Dart_NativeArguments arguments); 149 | void glProgramBinaryOES_native(Dart_NativeArguments arguments); 150 | void glUnmapBufferOES_native(Dart_NativeArguments arguments); 151 | void glPrimitiveBoundingBoxOES_native(Dart_NativeArguments arguments); 152 | void glMinSampleShadingOES_native(Dart_NativeArguments arguments); 153 | void glPatchParameteriOES_native(Dart_NativeArguments arguments); 154 | void glTexImage3DOES_native(Dart_NativeArguments arguments); 155 | void glTexSubImage3DOES_native(Dart_NativeArguments arguments); 156 | void glCopyTexSubImage3DOES_native(Dart_NativeArguments arguments); 157 | void glCompressedTexImage3DOES_native(Dart_NativeArguments arguments); 158 | void glCompressedTexSubImage3DOES_native(Dart_NativeArguments arguments); 159 | void glFramebufferTexture3DOES_native(Dart_NativeArguments arguments); 160 | void glTexBufferOES_native(Dart_NativeArguments arguments); 161 | void glTexBufferRangeOES_native(Dart_NativeArguments arguments); 162 | void glTexStorage3DMultisampleOES_native(Dart_NativeArguments arguments); 163 | void glTextureViewOES_native(Dart_NativeArguments arguments); 164 | void glBindVertexArrayOES_native(Dart_NativeArguments arguments); 165 | void glDeleteVertexArraysOES_native(Dart_NativeArguments arguments); 166 | void glGenVertexArraysOES_native(Dart_NativeArguments arguments); 167 | void glIsVertexArrayOES_native(Dart_NativeArguments arguments); 168 | void glViewportArrayvOES_native(Dart_NativeArguments arguments); 169 | void glViewportIndexedfOES_native(Dart_NativeArguments arguments); 170 | void glViewportIndexedfvOES_native(Dart_NativeArguments arguments); 171 | void glScissorArrayvOES_native(Dart_NativeArguments arguments); 172 | void glScissorIndexedOES_native(Dart_NativeArguments arguments); 173 | void glScissorIndexedvOES_native(Dart_NativeArguments arguments); 174 | void glDepthRangeArrayfvOES_native(Dart_NativeArguments arguments); 175 | void glDepthRangeIndexedfOES_native(Dart_NativeArguments arguments); 176 | void glGenPerfMonitorsAMD_native(Dart_NativeArguments arguments); 177 | void glDeletePerfMonitorsAMD_native(Dart_NativeArguments arguments); 178 | void glBeginPerfMonitorAMD_native(Dart_NativeArguments arguments); 179 | void glEndPerfMonitorAMD_native(Dart_NativeArguments arguments); 180 | void glBlitFramebufferANGLE_native(Dart_NativeArguments arguments); 181 | void glRenderbufferStorageMultisampleANGLE_native( 182 | Dart_NativeArguments arguments); 183 | void glDrawArraysInstancedANGLE_native(Dart_NativeArguments arguments); 184 | void glDrawElementsInstancedANGLE_native(Dart_NativeArguments arguments); 185 | void glVertexAttribDivisorANGLE_native(Dart_NativeArguments arguments); 186 | void glCopyTextureLevelsAPPLE_native(Dart_NativeArguments arguments); 187 | void glRenderbufferStorageMultisampleAPPLE_native( 188 | Dart_NativeArguments arguments); 189 | void glResolveMultisampleFramebufferAPPLE_native( 190 | Dart_NativeArguments arguments); 191 | void glDrawArraysInstancedBaseInstanceEXT_native( 192 | Dart_NativeArguments arguments); 193 | void glDrawElementsInstancedBaseInstanceEXT_native( 194 | Dart_NativeArguments arguments); 195 | void glDrawElementsInstancedBaseVertexBaseInstanceEXT_native( 196 | Dart_NativeArguments arguments); 197 | void glBindFragDataLocationIndexedEXT_native(Dart_NativeArguments arguments); 198 | void glBindFragDataLocationEXT_native(Dart_NativeArguments arguments); 199 | void glGetProgramResourceLocationIndexEXT_native( 200 | Dart_NativeArguments arguments); 201 | void glGetFragDataIndexEXT_native(Dart_NativeArguments arguments); 202 | void glBufferStorageEXT_native(Dart_NativeArguments arguments); 203 | void glClearTexImageEXT_native(Dart_NativeArguments arguments); 204 | void glClearTexSubImageEXT_native(Dart_NativeArguments arguments); 205 | void glCopyImageSubDataEXT_native(Dart_NativeArguments arguments); 206 | void glLabelObjectEXT_native(Dart_NativeArguments arguments); 207 | void glInsertEventMarkerEXT_native(Dart_NativeArguments arguments); 208 | void glPushGroupMarkerEXT_native(Dart_NativeArguments arguments); 209 | void glPopGroupMarkerEXT_native(Dart_NativeArguments arguments); 210 | void glGenQueriesEXT_native(Dart_NativeArguments arguments); 211 | void glDeleteQueriesEXT_native(Dart_NativeArguments arguments); 212 | void glIsQueryEXT_native(Dart_NativeArguments arguments); 213 | void glBeginQueryEXT_native(Dart_NativeArguments arguments); 214 | void glEndQueryEXT_native(Dart_NativeArguments arguments); 215 | void glQueryCounterEXT_native(Dart_NativeArguments arguments); 216 | void glEnableiEXT_native(Dart_NativeArguments arguments); 217 | void glDisableiEXT_native(Dart_NativeArguments arguments); 218 | void glBlendEquationiEXT_native(Dart_NativeArguments arguments); 219 | void glBlendEquationSeparateiEXT_native(Dart_NativeArguments arguments); 220 | void glBlendFunciEXT_native(Dart_NativeArguments arguments); 221 | void glBlendFuncSeparateiEXT_native(Dart_NativeArguments arguments); 222 | void glColorMaskiEXT_native(Dart_NativeArguments arguments); 223 | void glIsEnablediEXT_native(Dart_NativeArguments arguments); 224 | void glDrawElementsBaseVertexEXT_native(Dart_NativeArguments arguments); 225 | void glDrawRangeElementsBaseVertexEXT_native(Dart_NativeArguments arguments); 226 | void glDrawElementsInstancedBaseVertexEXT_native( 227 | Dart_NativeArguments arguments); 228 | void glDrawArraysInstancedEXT_native(Dart_NativeArguments arguments); 229 | void glDrawElementsInstancedEXT_native(Dart_NativeArguments arguments); 230 | void glDrawTransformFeedbackEXT_native(Dart_NativeArguments arguments); 231 | void glDrawTransformFeedbackInstancedEXT_native(Dart_NativeArguments arguments); 232 | void glFramebufferTextureEXT_native(Dart_NativeArguments arguments); 233 | void glVertexAttribDivisorEXT_native(Dart_NativeArguments arguments); 234 | void glFlushMappedBufferRangeEXT_native(Dart_NativeArguments arguments); 235 | void glDeleteMemoryObjectsEXT_native(Dart_NativeArguments arguments); 236 | void glIsMemoryObjectEXT_native(Dart_NativeArguments arguments); 237 | void glMultiDrawArraysIndirectEXT_native(Dart_NativeArguments arguments); 238 | void glMultiDrawElementsIndirectEXT_native(Dart_NativeArguments arguments); 239 | void glRenderbufferStorageMultisampleEXT_native(Dart_NativeArguments arguments); 240 | void glFramebufferTexture2DMultisampleEXT_native( 241 | Dart_NativeArguments arguments); 242 | void glReadBufferIndexedEXT_native(Dart_NativeArguments arguments); 243 | void glPolygonOffsetClampEXT_native(Dart_NativeArguments arguments); 244 | void glPrimitiveBoundingBoxEXT_native(Dart_NativeArguments arguments); 245 | void glRasterSamplesEXT_native(Dart_NativeArguments arguments); 246 | void glGetGraphicsResetStatusEXT_native(Dart_NativeArguments arguments); 247 | void glGenSemaphoresEXT_native(Dart_NativeArguments arguments); 248 | void glDeleteSemaphoresEXT_native(Dart_NativeArguments arguments); 249 | void glIsSemaphoreEXT_native(Dart_NativeArguments arguments); 250 | void glImportSemaphoreFdEXT_native(Dart_NativeArguments arguments); 251 | void glImportSemaphoreWin32NameEXT_native(Dart_NativeArguments arguments); 252 | void glActiveShaderProgramEXT_native(Dart_NativeArguments arguments); 253 | void glBindProgramPipelineEXT_native(Dart_NativeArguments arguments); 254 | void glDeleteProgramPipelinesEXT_native(Dart_NativeArguments arguments); 255 | void glGenProgramPipelinesEXT_native(Dart_NativeArguments arguments); 256 | void glIsProgramPipelineEXT_native(Dart_NativeArguments arguments); 257 | void glProgramParameteriEXT_native(Dart_NativeArguments arguments); 258 | void glProgramUniform1fEXT_native(Dart_NativeArguments arguments); 259 | void glProgramUniform1fvEXT_native(Dart_NativeArguments arguments); 260 | void glProgramUniform1iEXT_native(Dart_NativeArguments arguments); 261 | void glProgramUniform1ivEXT_native(Dart_NativeArguments arguments); 262 | void glProgramUniform2fEXT_native(Dart_NativeArguments arguments); 263 | void glProgramUniform2fvEXT_native(Dart_NativeArguments arguments); 264 | void glProgramUniform2iEXT_native(Dart_NativeArguments arguments); 265 | void glProgramUniform2ivEXT_native(Dart_NativeArguments arguments); 266 | void glProgramUniform3fEXT_native(Dart_NativeArguments arguments); 267 | void glProgramUniform3fvEXT_native(Dart_NativeArguments arguments); 268 | void glProgramUniform3iEXT_native(Dart_NativeArguments arguments); 269 | void glProgramUniform3ivEXT_native(Dart_NativeArguments arguments); 270 | void glProgramUniform4fEXT_native(Dart_NativeArguments arguments); 271 | void glProgramUniform4fvEXT_native(Dart_NativeArguments arguments); 272 | void glProgramUniform4iEXT_native(Dart_NativeArguments arguments); 273 | void glProgramUniform4ivEXT_native(Dart_NativeArguments arguments); 274 | void glProgramUniformMatrix2fvEXT_native(Dart_NativeArguments arguments); 275 | void glProgramUniformMatrix3fvEXT_native(Dart_NativeArguments arguments); 276 | void glProgramUniformMatrix4fvEXT_native(Dart_NativeArguments arguments); 277 | void glUseProgramStagesEXT_native(Dart_NativeArguments arguments); 278 | void glValidateProgramPipelineEXT_native(Dart_NativeArguments arguments); 279 | void glProgramUniform1uiEXT_native(Dart_NativeArguments arguments); 280 | void glProgramUniform2uiEXT_native(Dart_NativeArguments arguments); 281 | void glProgramUniform3uiEXT_native(Dart_NativeArguments arguments); 282 | void glProgramUniform4uiEXT_native(Dart_NativeArguments arguments); 283 | void glProgramUniformMatrix2x3fvEXT_native(Dart_NativeArguments arguments); 284 | void glProgramUniformMatrix3x2fvEXT_native(Dart_NativeArguments arguments); 285 | void glProgramUniformMatrix2x4fvEXT_native(Dart_NativeArguments arguments); 286 | void glProgramUniformMatrix4x2fvEXT_native(Dart_NativeArguments arguments); 287 | void glProgramUniformMatrix3x4fvEXT_native(Dart_NativeArguments arguments); 288 | void glProgramUniformMatrix4x3fvEXT_native(Dart_NativeArguments arguments); 289 | void glFramebufferPixelLocalStorageSizeEXT_native( 290 | Dart_NativeArguments arguments); 291 | void glGetFramebufferPixelLocalStorageSizeEXT_native( 292 | Dart_NativeArguments arguments); 293 | void glTexPageCommitmentEXT_native(Dart_NativeArguments arguments); 294 | void glPatchParameteriEXT_native(Dart_NativeArguments arguments); 295 | void glTexBufferEXT_native(Dart_NativeArguments arguments); 296 | void glTexBufferRangeEXT_native(Dart_NativeArguments arguments); 297 | void glTexStorage1DEXT_native(Dart_NativeArguments arguments); 298 | void glTexStorage2DEXT_native(Dart_NativeArguments arguments); 299 | void glTexStorage3DEXT_native(Dart_NativeArguments arguments); 300 | void glTextureStorage1DEXT_native(Dart_NativeArguments arguments); 301 | void glTextureStorage2DEXT_native(Dart_NativeArguments arguments); 302 | void glTextureStorage3DEXT_native(Dart_NativeArguments arguments); 303 | void glTextureViewEXT_native(Dart_NativeArguments arguments); 304 | void glFramebufferTexture2DDownsampleIMG_native(Dart_NativeArguments arguments); 305 | void glFramebufferTextureLayerDownsampleIMG_native( 306 | Dart_NativeArguments arguments); 307 | void glRenderbufferStorageMultisampleIMG_native(Dart_NativeArguments arguments); 308 | void glFramebufferTexture2DMultisampleIMG_native( 309 | Dart_NativeArguments arguments); 310 | void glApplyFramebufferAttachmentCMAAINTEL_native( 311 | Dart_NativeArguments arguments); 312 | void glBeginPerfQueryINTEL_native(Dart_NativeArguments arguments); 313 | void glDeletePerfQueryINTEL_native(Dart_NativeArguments arguments); 314 | void glEndPerfQueryINTEL_native(Dart_NativeArguments arguments); 315 | void glBlendParameteriNV_native(Dart_NativeArguments arguments); 316 | void glBlendBarrierNV_native(Dart_NativeArguments arguments); 317 | void glBeginConditionalRenderNV_native(Dart_NativeArguments arguments); 318 | void glEndConditionalRenderNV_native(Dart_NativeArguments arguments); 319 | void glSubpixelPrecisionBiasNV_native(Dart_NativeArguments arguments); 320 | void glConservativeRasterParameteriNV_native(Dart_NativeArguments arguments); 321 | void glCopyBufferSubDataNV_native(Dart_NativeArguments arguments); 322 | void glCoverageMaskNV_native(Dart_NativeArguments arguments); 323 | void glCoverageOperationNV_native(Dart_NativeArguments arguments); 324 | void glDrawArraysInstancedNV_native(Dart_NativeArguments arguments); 325 | void glDrawElementsInstancedNV_native(Dart_NativeArguments arguments); 326 | void glDeleteFencesNV_native(Dart_NativeArguments arguments); 327 | void glGenFencesNV_native(Dart_NativeArguments arguments); 328 | void glIsFenceNV_native(Dart_NativeArguments arguments); 329 | void glTestFenceNV_native(Dart_NativeArguments arguments); 330 | void glFinishFenceNV_native(Dart_NativeArguments arguments); 331 | void glSetFenceNV_native(Dart_NativeArguments arguments); 332 | void glFragmentCoverageColorNV_native(Dart_NativeArguments arguments); 333 | void glBlitFramebufferNV_native(Dart_NativeArguments arguments); 334 | void glCoverageModulationTableNV_native(Dart_NativeArguments arguments); 335 | void glCoverageModulationNV_native(Dart_NativeArguments arguments); 336 | void glRenderbufferStorageMultisampleNV_native(Dart_NativeArguments arguments); 337 | void glVertexAttribDivisorNV_native(Dart_NativeArguments arguments); 338 | void glUniformMatrix2x3fvNV_native(Dart_NativeArguments arguments); 339 | void glUniformMatrix3x2fvNV_native(Dart_NativeArguments arguments); 340 | void glUniformMatrix2x4fvNV_native(Dart_NativeArguments arguments); 341 | void glUniformMatrix4x2fvNV_native(Dart_NativeArguments arguments); 342 | void glUniformMatrix3x4fvNV_native(Dart_NativeArguments arguments); 343 | void glUniformMatrix4x3fvNV_native(Dart_NativeArguments arguments); 344 | void glGenPathsNV_native(Dart_NativeArguments arguments); 345 | void glDeletePathsNV_native(Dart_NativeArguments arguments); 346 | void glIsPathNV_native(Dart_NativeArguments arguments); 347 | void glPathCoordsNV_native(Dart_NativeArguments arguments); 348 | void glPathSubCommandsNV_native(Dart_NativeArguments arguments); 349 | void glPathSubCoordsNV_native(Dart_NativeArguments arguments); 350 | void glPathStringNV_native(Dart_NativeArguments arguments); 351 | void glPathGlyphsNV_native(Dart_NativeArguments arguments); 352 | void glPathGlyphRangeNV_native(Dart_NativeArguments arguments); 353 | void glCopyPathNV_native(Dart_NativeArguments arguments); 354 | void glInterpolatePathsNV_native(Dart_NativeArguments arguments); 355 | void glPathParameterivNV_native(Dart_NativeArguments arguments); 356 | void glPathParameteriNV_native(Dart_NativeArguments arguments); 357 | void glPathParameterfvNV_native(Dart_NativeArguments arguments); 358 | void glPathParameterfNV_native(Dart_NativeArguments arguments); 359 | void glPathStencilFuncNV_native(Dart_NativeArguments arguments); 360 | void glPathStencilDepthOffsetNV_native(Dart_NativeArguments arguments); 361 | void glStencilFillPathNV_native(Dart_NativeArguments arguments); 362 | void glStencilStrokePathNV_native(Dart_NativeArguments arguments); 363 | void glPathCoverDepthFuncNV_native(Dart_NativeArguments arguments); 364 | void glCoverFillPathNV_native(Dart_NativeArguments arguments); 365 | void glCoverStrokePathNV_native(Dart_NativeArguments arguments); 366 | void glIsPointInFillPathNV_native(Dart_NativeArguments arguments); 367 | void glIsPointInStrokePathNV_native(Dart_NativeArguments arguments); 368 | void glGetPathLengthNV_native(Dart_NativeArguments arguments); 369 | void glStencilThenCoverFillPathNV_native(Dart_NativeArguments arguments); 370 | void glStencilThenCoverStrokePathNV_native(Dart_NativeArguments arguments); 371 | void glPathGlyphIndexArrayNV_native(Dart_NativeArguments arguments); 372 | void glPathMemoryGlyphIndexArrayNV_native(Dart_NativeArguments arguments); 373 | void glPolygonModeNV_native(Dart_NativeArguments arguments); 374 | void glReadBufferNV_native(Dart_NativeArguments arguments); 375 | void glFramebufferSampleLocationsfvNV_native(Dart_NativeArguments arguments); 376 | void glNamedFramebufferSampleLocationsfvNV_native( 377 | Dart_NativeArguments arguments); 378 | void glResolveDepthValuesNV_native(Dart_NativeArguments arguments); 379 | void glViewportArrayvNV_native(Dart_NativeArguments arguments); 380 | void glViewportIndexedfNV_native(Dart_NativeArguments arguments); 381 | void glViewportIndexedfvNV_native(Dart_NativeArguments arguments); 382 | void glScissorArrayvNV_native(Dart_NativeArguments arguments); 383 | void glScissorIndexedNV_native(Dart_NativeArguments arguments); 384 | void glScissorIndexedvNV_native(Dart_NativeArguments arguments); 385 | void glDepthRangeArrayfvNV_native(Dart_NativeArguments arguments); 386 | void glDepthRangeIndexedfNV_native(Dart_NativeArguments arguments); 387 | void glEnableiNV_native(Dart_NativeArguments arguments); 388 | void glDisableiNV_native(Dart_NativeArguments arguments); 389 | void glIsEnablediNV_native(Dart_NativeArguments arguments); 390 | void glViewportSwizzleNV_native(Dart_NativeArguments arguments); 391 | void glFramebufferTextureMultiviewOVR_native(Dart_NativeArguments arguments); 392 | void glFramebufferTextureMultisampleMultiviewOVR_native( 393 | Dart_NativeArguments arguments); 394 | void glAlphaFuncQCOM_native(Dart_NativeArguments arguments); 395 | void glEnableDriverControlQCOM_native(Dart_NativeArguments arguments); 396 | void glDisableDriverControlQCOM_native(Dart_NativeArguments arguments); 397 | void glExtTexObjectStateOverrideiQCOM_native(Dart_NativeArguments arguments); 398 | void glExtIsProgramBinaryQCOM_native(Dart_NativeArguments arguments); 399 | void glFramebufferFoveationParametersQCOM_native( 400 | Dart_NativeArguments arguments); 401 | void glFramebufferFetchBarrierQCOM_native(Dart_NativeArguments arguments); 402 | void glStartTilingQCOM_native(Dart_NativeArguments arguments); 403 | void glEndTilingQCOM_native(Dart_NativeArguments arguments); 404 | 405 | #endif // DART_GL_LIB_SRC_GENERATED_GENERATED_BINDINGS_H_ 406 | -------------------------------------------------------------------------------- /lib/src/generated/gl_native_functions.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | // This file is auto-generated by scripts in the tools/ directory. 7 | 8 | /// Dart definitions for GL native extension. 9 | part of gl; 10 | 11 | void glActiveTexture(int texture) native "glActiveTexture"; 12 | void glAttachShader(int program, int shader) native "glAttachShader"; 13 | void glBindAttribLocation(int program, int index, String name) 14 | native "glBindAttribLocation"; 15 | void glBindBuffer(int target, int buffer) native "glBindBuffer"; 16 | void glBindFramebuffer(int target, int framebuffer) native "glBindFramebuffer"; 17 | void glBindRenderbuffer(int target, int renderbuffer) 18 | native "glBindRenderbuffer"; 19 | void glBindTexture(int target, int texture) native "glBindTexture"; 20 | void glBlendColor(double red, double green, double blue, double alpha) 21 | native "glBlendColor"; 22 | void glBlendEquation(int mode) native "glBlendEquation"; 23 | void glBlendEquationSeparate(int modeRGB, int modeAlpha) 24 | native "glBlendEquationSeparate"; 25 | void glBlendFunc(int sfactor, int dfactor) native "glBlendFunc"; 26 | void glBlendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha, 27 | int dfactorAlpha) native "glBlendFuncSeparate"; 28 | void glBufferData(int target, int size, TypedData data, int usage) 29 | native "glBufferData"; 30 | void glBufferSubData(int target, int offset, int size, TypedData data) 31 | native "glBufferSubData"; 32 | int glCheckFramebufferStatus(int target) native "glCheckFramebufferStatus"; 33 | void glClear(int mask) native "glClear"; 34 | void glClearColor(double red, double green, double blue, double alpha) 35 | native "glClearColor"; 36 | void glClearDepthf(double d) native "glClearDepthf"; 37 | void glClearStencil(int s) native "glClearStencil"; 38 | void glColorMask(int red, int green, int blue, int alpha) native "glColorMask"; 39 | void glCompileShader(int shader) native "glCompileShader"; 40 | void glCompressedTexImage2D( 41 | int target, 42 | int level, 43 | int internalformat, 44 | int width, 45 | int height, 46 | int border, 47 | int imageSize, 48 | TypedData data) native "glCompressedTexImage2D"; 49 | void glCompressedTexSubImage2D( 50 | int target, 51 | int level, 52 | int xoffset, 53 | int yoffset, 54 | int width, 55 | int height, 56 | int format, 57 | int imageSize, 58 | TypedData data) native "glCompressedTexSubImage2D"; 59 | void glCopyTexImage2D(int target, int level, int internalformat, int x, int y, 60 | int width, int height, int border) native "glCopyTexImage2D"; 61 | void glCopyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, 62 | int y, int width, int height) native "glCopyTexSubImage2D"; 63 | int glCreateProgram() native "glCreateProgram"; 64 | int glCreateShader(int type) native "glCreateShader"; 65 | void glCullFace(int mode) native "glCullFace"; 66 | void glDeleteBuffers(List values) native "glDeleteBuffers"; 67 | void glDeleteFramebuffers(List values) native "glDeleteFramebuffers"; 68 | void glDeleteProgram(int program) native "glDeleteProgram"; 69 | void glDeleteRenderbuffers(List values) native "glDeleteRenderbuffers"; 70 | void glDeleteShader(int shader) native "glDeleteShader"; 71 | void glDeleteTextures(List values) native "glDeleteTextures"; 72 | void glDepthFunc(int func) native "glDepthFunc"; 73 | void glDepthMask(int flag) native "glDepthMask"; 74 | void glDepthRangef(double n, double f) native "glDepthRangef"; 75 | void glDetachShader(int program, int shader) native "glDetachShader"; 76 | void glDisable(int cap) native "glDisable"; 77 | void glDisableVertexAttribArray(int index) native "glDisableVertexAttribArray"; 78 | void glDrawArrays(int mode, int first, int count) native "glDrawArrays"; 79 | void glDrawElements(int mode, int count, int type, TypedData indices) 80 | native "glDrawElements"; 81 | void glEnable(int cap) native "glEnable"; 82 | void glEnableVertexAttribArray(int index) native "glEnableVertexAttribArray"; 83 | void glFinish() native "glFinish"; 84 | void glFlush() native "glFlush"; 85 | void glFramebufferRenderbuffer( 86 | int target, 87 | int attachment, 88 | int renderbuffertarget, 89 | int renderbuffer) native "glFramebufferRenderbuffer"; 90 | void glFramebufferTexture2D(int target, int attachment, int textarget, 91 | int texture, int level) native "glFramebufferTexture2D"; 92 | void glFrontFace(int mode) native "glFrontFace"; 93 | List glGenBuffers(int n) native "glGenBuffers"; 94 | void glGenerateMipmap(int target) native "glGenerateMipmap"; 95 | List glGenFramebuffers(int n) native "glGenFramebuffers"; 96 | List glGenRenderbuffers(int n) native "glGenRenderbuffers"; 97 | List glGenTextures(int n) native "glGenTextures"; 98 | int glGetAttribLocation(int program, String name) native "glGetAttribLocation"; 99 | int glGetError() native "glGetError"; 100 | String glGetString(int name) native "glGetString"; 101 | int glGetUniformLocation(int program, String name) 102 | native "glGetUniformLocation"; 103 | void glHint(int target, int mode) native "glHint"; 104 | bool glIsBuffer(int buffer) native "glIsBuffer"; 105 | bool glIsEnabled(int cap) native "glIsEnabled"; 106 | bool glIsFramebuffer(int framebuffer) native "glIsFramebuffer"; 107 | bool glIsProgram(int program) native "glIsProgram"; 108 | bool glIsRenderbuffer(int renderbuffer) native "glIsRenderbuffer"; 109 | bool glIsShader(int shader) native "glIsShader"; 110 | bool glIsTexture(int texture) native "glIsTexture"; 111 | void glLineWidth(double width) native "glLineWidth"; 112 | void glLinkProgram(int program) native "glLinkProgram"; 113 | void glPixelStorei(int pname, int param) native "glPixelStorei"; 114 | void glPolygonOffset(double factor, double units) native "glPolygonOffset"; 115 | void glReleaseShaderCompiler() native "glReleaseShaderCompiler"; 116 | void glRenderbufferStorage(int target, int internalformat, int width, 117 | int height) native "glRenderbufferStorage"; 118 | void glSampleCoverage(double value, int invert) native "glSampleCoverage"; 119 | void glScissor(int x, int y, int width, int height) native "glScissor"; 120 | void glStencilFunc(int func, int ref, int mask) native "glStencilFunc"; 121 | void glStencilFuncSeparate(int face, int func, int ref, int mask) 122 | native "glStencilFuncSeparate"; 123 | void glStencilMask(int mask) native "glStencilMask"; 124 | void glStencilMaskSeparate(int face, int mask) native "glStencilMaskSeparate"; 125 | void glStencilOp(int fail, int zfail, int zpass) native "glStencilOp"; 126 | void glStencilOpSeparate(int face, int sfail, int dpfail, int dppass) 127 | native "glStencilOpSeparate"; 128 | void glTexImage2D( 129 | int target, 130 | int level, 131 | int internalformat, 132 | int width, 133 | int height, 134 | int border, 135 | int format, 136 | int type, 137 | TypedData pixels) native "glTexImage2D"; 138 | void glTexParameterf(int target, int pname, double param) 139 | native "glTexParameterf"; 140 | void glTexParameteri(int target, int pname, int param) native "glTexParameteri"; 141 | void glTexSubImage2D( 142 | int target, 143 | int level, 144 | int xoffset, 145 | int yoffset, 146 | int width, 147 | int height, 148 | int format, 149 | int type, 150 | TypedData pixels) native "glTexSubImage2D"; 151 | void glUniform1f(int location, double v0) native "glUniform1f"; 152 | void glUniform1fv(int location, int count, TypedData value) 153 | native "glUniform1fv"; 154 | void glUniform1i(int location, int v0) native "glUniform1i"; 155 | void glUniform1iv(int location, int count, TypedData value) 156 | native "glUniform1iv"; 157 | void glUniform2f(int location, double v0, double v1) native "glUniform2f"; 158 | void glUniform2fv(int location, int count, TypedData value) 159 | native "glUniform2fv"; 160 | void glUniform2i(int location, int v0, int v1) native "glUniform2i"; 161 | void glUniform2iv(int location, int count, TypedData value) 162 | native "glUniform2iv"; 163 | void glUniform3f(int location, double v0, double v1, double v2) 164 | native "glUniform3f"; 165 | void glUniform3fv(int location, int count, TypedData value) 166 | native "glUniform3fv"; 167 | void glUniform3i(int location, int v0, int v1, int v2) native "glUniform3i"; 168 | void glUniform3iv(int location, int count, TypedData value) 169 | native "glUniform3iv"; 170 | void glUniform4f(int location, double v0, double v1, double v2, double v3) 171 | native "glUniform4f"; 172 | void glUniform4fv(int location, int count, TypedData value) 173 | native "glUniform4fv"; 174 | void glUniform4i(int location, int v0, int v1, int v2, int v3) 175 | native "glUniform4i"; 176 | void glUniform4iv(int location, int count, TypedData value) 177 | native "glUniform4iv"; 178 | void glUniformMatrix2fv(int location, int count, int transpose, TypedData value) 179 | native "glUniformMatrix2fv"; 180 | void glUniformMatrix3fv(int location, int count, int transpose, TypedData value) 181 | native "glUniformMatrix3fv"; 182 | void glUniformMatrix4fv(int location, int count, int transpose, TypedData value) 183 | native "glUniformMatrix4fv"; 184 | void glUseProgram(int program) native "glUseProgram"; 185 | void glValidateProgram(int program) native "glValidateProgram"; 186 | void glVertexAttrib1f(int index, double x) native "glVertexAttrib1f"; 187 | void glVertexAttrib1fv(int index, TypedData v) native "glVertexAttrib1fv"; 188 | void glVertexAttrib2f(int index, double x, double y) native "glVertexAttrib2f"; 189 | void glVertexAttrib2fv(int index, TypedData v) native "glVertexAttrib2fv"; 190 | void glVertexAttrib3f(int index, double x, double y, double z) 191 | native "glVertexAttrib3f"; 192 | void glVertexAttrib3fv(int index, TypedData v) native "glVertexAttrib3fv"; 193 | void glVertexAttrib4f(int index, double x, double y, double z, double w) 194 | native "glVertexAttrib4f"; 195 | void glVertexAttrib4fv(int index, TypedData v) native "glVertexAttrib4fv"; 196 | void glViewport(int x, int y, int width, int height) native "glViewport"; 197 | void glBlendBarrierKHR() native "glBlendBarrierKHR"; 198 | void glDebugMessageInsertKHR(int source, int type, int id, int severity, 199 | int length, String buf) native "glDebugMessageInsertKHR"; 200 | void glPushDebugGroupKHR(int source, int id, int length, String message) 201 | native "glPushDebugGroupKHR"; 202 | void glPopDebugGroupKHR() native "glPopDebugGroupKHR"; 203 | void glObjectLabelKHR(int identifier, int name, int length, String label) 204 | native "glObjectLabelKHR"; 205 | void glObjectPtrLabelKHR(TypedData ptr, int length, String label) 206 | native "glObjectPtrLabelKHR"; 207 | int glGetGraphicsResetStatusKHR() native "glGetGraphicsResetStatusKHR"; 208 | void glCopyImageSubDataOES( 209 | int srcName, 210 | int srcTarget, 211 | int srcLevel, 212 | int srcX, 213 | int srcY, 214 | int srcZ, 215 | int dstName, 216 | int dstTarget, 217 | int dstLevel, 218 | int dstX, 219 | int dstY, 220 | int dstZ, 221 | int srcWidth, 222 | int srcHeight, 223 | int srcDepth) native "glCopyImageSubDataOES"; 224 | void glEnableiOES(int target, int index) native "glEnableiOES"; 225 | void glDisableiOES(int target, int index) native "glDisableiOES"; 226 | void glBlendEquationiOES(int buf, int mode) native "glBlendEquationiOES"; 227 | void glBlendEquationSeparateiOES(int buf, int modeRGB, int modeAlpha) 228 | native "glBlendEquationSeparateiOES"; 229 | void glBlendFunciOES(int buf, int src, int dst) native "glBlendFunciOES"; 230 | void glBlendFuncSeparateiOES(int buf, int srcRGB, int dstRGB, int srcAlpha, 231 | int dstAlpha) native "glBlendFuncSeparateiOES"; 232 | void glColorMaskiOES(int index, int r, int g, int b, int a) 233 | native "glColorMaskiOES"; 234 | bool glIsEnablediOES(int target, int index) native "glIsEnablediOES"; 235 | void glDrawElementsBaseVertexOES(int mode, int count, int type, 236 | TypedData indices, int basevertex) native "glDrawElementsBaseVertexOES"; 237 | void glDrawRangeElementsBaseVertexOES( 238 | int mode, 239 | int start, 240 | int end, 241 | int count, 242 | int type, 243 | TypedData indices, 244 | int basevertex) native "glDrawRangeElementsBaseVertexOES"; 245 | void glDrawElementsInstancedBaseVertexOES( 246 | int mode, 247 | int count, 248 | int type, 249 | TypedData indices, 250 | int instancecount, 251 | int basevertex) native "glDrawElementsInstancedBaseVertexOES"; 252 | void glFramebufferTextureOES(int target, int attachment, int texture, int level) 253 | native "glFramebufferTextureOES"; 254 | void glProgramBinaryOES(int program, int binaryFormat, TypedData binary, 255 | int length) native "glProgramBinaryOES"; 256 | bool glUnmapBufferOES(int target) native "glUnmapBufferOES"; 257 | void glPrimitiveBoundingBoxOES( 258 | double minX, 259 | double minY, 260 | double minZ, 261 | double minW, 262 | double maxX, 263 | double maxY, 264 | double maxZ, 265 | double maxW) native "glPrimitiveBoundingBoxOES"; 266 | void glMinSampleShadingOES(double value) native "glMinSampleShadingOES"; 267 | void glPatchParameteriOES(int pname, int value) native "glPatchParameteriOES"; 268 | void glTexImage3DOES( 269 | int target, 270 | int level, 271 | int internalformat, 272 | int width, 273 | int height, 274 | int depth, 275 | int border, 276 | int format, 277 | int type, 278 | TypedData pixels) native "glTexImage3DOES"; 279 | void glTexSubImage3DOES( 280 | int target, 281 | int level, 282 | int xoffset, 283 | int yoffset, 284 | int zoffset, 285 | int width, 286 | int height, 287 | int depth, 288 | int format, 289 | int type, 290 | TypedData pixels) native "glTexSubImage3DOES"; 291 | void glCopyTexSubImage3DOES( 292 | int target, 293 | int level, 294 | int xoffset, 295 | int yoffset, 296 | int zoffset, 297 | int x, 298 | int y, 299 | int width, 300 | int height) native "glCopyTexSubImage3DOES"; 301 | void glCompressedTexImage3DOES( 302 | int target, 303 | int level, 304 | int internalformat, 305 | int width, 306 | int height, 307 | int depth, 308 | int border, 309 | int imageSize, 310 | TypedData data) native "glCompressedTexImage3DOES"; 311 | void glCompressedTexSubImage3DOES( 312 | int target, 313 | int level, 314 | int xoffset, 315 | int yoffset, 316 | int zoffset, 317 | int width, 318 | int height, 319 | int depth, 320 | int format, 321 | int imageSize, 322 | TypedData data) native "glCompressedTexSubImage3DOES"; 323 | void glFramebufferTexture3DOES(int target, int attachment, int textarget, 324 | int texture, int level, int zoffset) native "glFramebufferTexture3DOES"; 325 | void glTexBufferOES(int target, int internalformat, int buffer) 326 | native "glTexBufferOES"; 327 | void glTexBufferRangeOES(int target, int internalformat, int buffer, int offset, 328 | int size) native "glTexBufferRangeOES"; 329 | void glTexStorage3DMultisampleOES( 330 | int target, 331 | int samples, 332 | int internalformat, 333 | int width, 334 | int height, 335 | int depth, 336 | int fixedsamplelocations) native "glTexStorage3DMultisampleOES"; 337 | void glTextureViewOES( 338 | int texture, 339 | int target, 340 | int origtexture, 341 | int internalformat, 342 | int minlevel, 343 | int numlevels, 344 | int minlayer, 345 | int numlayers) native "glTextureViewOES"; 346 | void glBindVertexArrayOES(int array) native "glBindVertexArrayOES"; 347 | void glDeleteVertexArraysOES(List values) native "glDeleteVertexArraysOES"; 348 | List glGenVertexArraysOES(int n) native "glGenVertexArraysOES"; 349 | bool glIsVertexArrayOES(int array) native "glIsVertexArrayOES"; 350 | void glViewportArrayvOES(int first, int count, TypedData v) 351 | native "glViewportArrayvOES"; 352 | void glViewportIndexedfOES(int index, double x, double y, double w, double h) 353 | native "glViewportIndexedfOES"; 354 | void glViewportIndexedfvOES(int index, TypedData v) 355 | native "glViewportIndexedfvOES"; 356 | void glScissorArrayvOES(int first, int count, TypedData v) 357 | native "glScissorArrayvOES"; 358 | void glScissorIndexedOES(int index, int left, int bottom, int width, int height) 359 | native "glScissorIndexedOES"; 360 | void glScissorIndexedvOES(int index, TypedData v) native "glScissorIndexedvOES"; 361 | void glDepthRangeArrayfvOES(int first, int count, TypedData v) 362 | native "glDepthRangeArrayfvOES"; 363 | void glDepthRangeIndexedfOES(int index, double n, double f) 364 | native "glDepthRangeIndexedfOES"; 365 | List glGenPerfMonitorsAMD(int n) native "glGenPerfMonitorsAMD"; 366 | void glDeletePerfMonitorsAMD(List values) native "glDeletePerfMonitorsAMD"; 367 | void glBeginPerfMonitorAMD(int monitor) native "glBeginPerfMonitorAMD"; 368 | void glEndPerfMonitorAMD(int monitor) native "glEndPerfMonitorAMD"; 369 | void glBlitFramebufferANGLE( 370 | int srcX0, 371 | int srcY0, 372 | int srcX1, 373 | int srcY1, 374 | int dstX0, 375 | int dstY0, 376 | int dstX1, 377 | int dstY1, 378 | int mask, 379 | int filter) native "glBlitFramebufferANGLE"; 380 | void glRenderbufferStorageMultisampleANGLE( 381 | int target, 382 | int samples, 383 | int internalformat, 384 | int width, 385 | int height) native "glRenderbufferStorageMultisampleANGLE"; 386 | void glDrawArraysInstancedANGLE(int mode, int first, int count, int primcount) 387 | native "glDrawArraysInstancedANGLE"; 388 | void glDrawElementsInstancedANGLE(int mode, int count, int type, 389 | TypedData indices, int primcount) native "glDrawElementsInstancedANGLE"; 390 | void glVertexAttribDivisorANGLE(int index, int divisor) 391 | native "glVertexAttribDivisorANGLE"; 392 | void glCopyTextureLevelsAPPLE( 393 | int destinationTexture, 394 | int sourceTexture, 395 | int sourceBaseLevel, 396 | int sourceLevelCount) native "glCopyTextureLevelsAPPLE"; 397 | void glRenderbufferStorageMultisampleAPPLE( 398 | int target, 399 | int samples, 400 | int internalformat, 401 | int width, 402 | int height) native "glRenderbufferStorageMultisampleAPPLE"; 403 | void glResolveMultisampleFramebufferAPPLE() 404 | native "glResolveMultisampleFramebufferAPPLE"; 405 | void glDrawArraysInstancedBaseInstanceEXT( 406 | int mode, 407 | int first, 408 | int count, 409 | int instancecount, 410 | int baseinstance) native "glDrawArraysInstancedBaseInstanceEXT"; 411 | void glDrawElementsInstancedBaseInstanceEXT( 412 | int mode, 413 | int count, 414 | int type, 415 | TypedData indices, 416 | int instancecount, 417 | int baseinstance) native "glDrawElementsInstancedBaseInstanceEXT"; 418 | void glDrawElementsInstancedBaseVertexBaseInstanceEXT( 419 | int mode, 420 | int count, 421 | int type, 422 | TypedData indices, 423 | int instancecount, 424 | int basevertex, 425 | int baseinstance) native "glDrawElementsInstancedBaseVertexBaseInstanceEXT"; 426 | void glBindFragDataLocationIndexedEXT(int program, int colorNumber, int index, 427 | String name) native "glBindFragDataLocationIndexedEXT"; 428 | void glBindFragDataLocationEXT(int program, int color, String name) 429 | native "glBindFragDataLocationEXT"; 430 | int glGetProgramResourceLocationIndexEXT(int program, int programInterface, 431 | String name) native "glGetProgramResourceLocationIndexEXT"; 432 | int glGetFragDataIndexEXT(int program, String name) 433 | native "glGetFragDataIndexEXT"; 434 | void glBufferStorageEXT(int target, int size, TypedData data, int flags) 435 | native "glBufferStorageEXT"; 436 | void glClearTexImageEXT(int texture, int level, int format, int type, 437 | TypedData data) native "glClearTexImageEXT"; 438 | void glClearTexSubImageEXT( 439 | int texture, 440 | int level, 441 | int xoffset, 442 | int yoffset, 443 | int zoffset, 444 | int width, 445 | int height, 446 | int depth, 447 | int format, 448 | int type, 449 | TypedData data) native "glClearTexSubImageEXT"; 450 | void glCopyImageSubDataEXT( 451 | int srcName, 452 | int srcTarget, 453 | int srcLevel, 454 | int srcX, 455 | int srcY, 456 | int srcZ, 457 | int dstName, 458 | int dstTarget, 459 | int dstLevel, 460 | int dstX, 461 | int dstY, 462 | int dstZ, 463 | int srcWidth, 464 | int srcHeight, 465 | int srcDepth) native "glCopyImageSubDataEXT"; 466 | void glLabelObjectEXT(int type, int object, int length, String label) 467 | native "glLabelObjectEXT"; 468 | void glInsertEventMarkerEXT(int length, String marker) 469 | native "glInsertEventMarkerEXT"; 470 | void glPushGroupMarkerEXT(int length, String marker) 471 | native "glPushGroupMarkerEXT"; 472 | void glPopGroupMarkerEXT() native "glPopGroupMarkerEXT"; 473 | List glGenQueriesEXT(int n) native "glGenQueriesEXT"; 474 | void glDeleteQueriesEXT(List values) native "glDeleteQueriesEXT"; 475 | bool glIsQueryEXT(int id) native "glIsQueryEXT"; 476 | void glBeginQueryEXT(int target, int id) native "glBeginQueryEXT"; 477 | void glEndQueryEXT(int target) native "glEndQueryEXT"; 478 | void glQueryCounterEXT(int id, int target) native "glQueryCounterEXT"; 479 | void glEnableiEXT(int target, int index) native "glEnableiEXT"; 480 | void glDisableiEXT(int target, int index) native "glDisableiEXT"; 481 | void glBlendEquationiEXT(int buf, int mode) native "glBlendEquationiEXT"; 482 | void glBlendEquationSeparateiEXT(int buf, int modeRGB, int modeAlpha) 483 | native "glBlendEquationSeparateiEXT"; 484 | void glBlendFunciEXT(int buf, int src, int dst) native "glBlendFunciEXT"; 485 | void glBlendFuncSeparateiEXT(int buf, int srcRGB, int dstRGB, int srcAlpha, 486 | int dstAlpha) native "glBlendFuncSeparateiEXT"; 487 | void glColorMaskiEXT(int index, int r, int g, int b, int a) 488 | native "glColorMaskiEXT"; 489 | bool glIsEnablediEXT(int target, int index) native "glIsEnablediEXT"; 490 | void glDrawElementsBaseVertexEXT(int mode, int count, int type, 491 | TypedData indices, int basevertex) native "glDrawElementsBaseVertexEXT"; 492 | void glDrawRangeElementsBaseVertexEXT( 493 | int mode, 494 | int start, 495 | int end, 496 | int count, 497 | int type, 498 | TypedData indices, 499 | int basevertex) native "glDrawRangeElementsBaseVertexEXT"; 500 | void glDrawElementsInstancedBaseVertexEXT( 501 | int mode, 502 | int count, 503 | int type, 504 | TypedData indices, 505 | int instancecount, 506 | int basevertex) native "glDrawElementsInstancedBaseVertexEXT"; 507 | void glDrawArraysInstancedEXT(int mode, int start, int count, int primcount) 508 | native "glDrawArraysInstancedEXT"; 509 | void glDrawElementsInstancedEXT(int mode, int count, int type, 510 | TypedData indices, int primcount) native "glDrawElementsInstancedEXT"; 511 | void glDrawTransformFeedbackEXT(int mode, int id) 512 | native "glDrawTransformFeedbackEXT"; 513 | void glDrawTransformFeedbackInstancedEXT(int mode, int id, int instancecount) 514 | native "glDrawTransformFeedbackInstancedEXT"; 515 | void glFramebufferTextureEXT(int target, int attachment, int texture, int level) 516 | native "glFramebufferTextureEXT"; 517 | void glVertexAttribDivisorEXT(int index, int divisor) 518 | native "glVertexAttribDivisorEXT"; 519 | void glFlushMappedBufferRangeEXT(int target, int offset, int length) 520 | native "glFlushMappedBufferRangeEXT"; 521 | void glDeleteMemoryObjectsEXT(List values) 522 | native "glDeleteMemoryObjectsEXT"; 523 | bool glIsMemoryObjectEXT(int memoryObject) native "glIsMemoryObjectEXT"; 524 | void glMultiDrawArraysIndirectEXT(int mode, TypedData indirect, int drawcount, 525 | int stride) native "glMultiDrawArraysIndirectEXT"; 526 | void glMultiDrawElementsIndirectEXT(int mode, int type, TypedData indirect, 527 | int drawcount, int stride) native "glMultiDrawElementsIndirectEXT"; 528 | void glRenderbufferStorageMultisampleEXT( 529 | int target, 530 | int samples, 531 | int internalformat, 532 | int width, 533 | int height) native "glRenderbufferStorageMultisampleEXT"; 534 | void glFramebufferTexture2DMultisampleEXT( 535 | int target, 536 | int attachment, 537 | int textarget, 538 | int texture, 539 | int level, 540 | int samples) native "glFramebufferTexture2DMultisampleEXT"; 541 | void glReadBufferIndexedEXT(int src, int index) native "glReadBufferIndexedEXT"; 542 | void glPolygonOffsetClampEXT(double factor, double units, double clamp) 543 | native "glPolygonOffsetClampEXT"; 544 | void glPrimitiveBoundingBoxEXT( 545 | double minX, 546 | double minY, 547 | double minZ, 548 | double minW, 549 | double maxX, 550 | double maxY, 551 | double maxZ, 552 | double maxW) native "glPrimitiveBoundingBoxEXT"; 553 | void glRasterSamplesEXT(int samples, int fixedsamplelocations) 554 | native "glRasterSamplesEXT"; 555 | int glGetGraphicsResetStatusEXT() native "glGetGraphicsResetStatusEXT"; 556 | List glGenSemaphoresEXT(int n) native "glGenSemaphoresEXT"; 557 | void glDeleteSemaphoresEXT(List values) native "glDeleteSemaphoresEXT"; 558 | bool glIsSemaphoreEXT(int semaphore) native "glIsSemaphoreEXT"; 559 | void glImportSemaphoreFdEXT(int semaphore, int handleType, int fd) 560 | native "glImportSemaphoreFdEXT"; 561 | void glImportSemaphoreWin32NameEXT(int semaphore, int handleType, 562 | TypedData name) native "glImportSemaphoreWin32NameEXT"; 563 | void glActiveShaderProgramEXT(int pipeline, int program) 564 | native "glActiveShaderProgramEXT"; 565 | void glBindProgramPipelineEXT(int pipeline) native "glBindProgramPipelineEXT"; 566 | void glDeleteProgramPipelinesEXT(List values) 567 | native "glDeleteProgramPipelinesEXT"; 568 | List glGenProgramPipelinesEXT(int n) native "glGenProgramPipelinesEXT"; 569 | bool glIsProgramPipelineEXT(int pipeline) native "glIsProgramPipelineEXT"; 570 | void glProgramParameteriEXT(int program, int pname, int value) 571 | native "glProgramParameteriEXT"; 572 | void glProgramUniform1fEXT(int program, int location, double v0) 573 | native "glProgramUniform1fEXT"; 574 | void glProgramUniform1fvEXT(int program, int location, int count, 575 | TypedData value) native "glProgramUniform1fvEXT"; 576 | void glProgramUniform1iEXT(int program, int location, int v0) 577 | native "glProgramUniform1iEXT"; 578 | void glProgramUniform1ivEXT(int program, int location, int count, 579 | TypedData value) native "glProgramUniform1ivEXT"; 580 | void glProgramUniform2fEXT(int program, int location, double v0, double v1) 581 | native "glProgramUniform2fEXT"; 582 | void glProgramUniform2fvEXT(int program, int location, int count, 583 | TypedData value) native "glProgramUniform2fvEXT"; 584 | void glProgramUniform2iEXT(int program, int location, int v0, int v1) 585 | native "glProgramUniform2iEXT"; 586 | void glProgramUniform2ivEXT(int program, int location, int count, 587 | TypedData value) native "glProgramUniform2ivEXT"; 588 | void glProgramUniform3fEXT(int program, int location, double v0, double v1, 589 | double v2) native "glProgramUniform3fEXT"; 590 | void glProgramUniform3fvEXT(int program, int location, int count, 591 | TypedData value) native "glProgramUniform3fvEXT"; 592 | void glProgramUniform3iEXT(int program, int location, int v0, int v1, int v2) 593 | native "glProgramUniform3iEXT"; 594 | void glProgramUniform3ivEXT(int program, int location, int count, 595 | TypedData value) native "glProgramUniform3ivEXT"; 596 | void glProgramUniform4fEXT(int program, int location, double v0, double v1, 597 | double v2, double v3) native "glProgramUniform4fEXT"; 598 | void glProgramUniform4fvEXT(int program, int location, int count, 599 | TypedData value) native "glProgramUniform4fvEXT"; 600 | void glProgramUniform4iEXT(int program, int location, int v0, int v1, int v2, 601 | int v3) native "glProgramUniform4iEXT"; 602 | void glProgramUniform4ivEXT(int program, int location, int count, 603 | TypedData value) native "glProgramUniform4ivEXT"; 604 | void glProgramUniformMatrix2fvEXT(int program, int location, int count, 605 | int transpose, TypedData value) native "glProgramUniformMatrix2fvEXT"; 606 | void glProgramUniformMatrix3fvEXT(int program, int location, int count, 607 | int transpose, TypedData value) native "glProgramUniformMatrix3fvEXT"; 608 | void glProgramUniformMatrix4fvEXT(int program, int location, int count, 609 | int transpose, TypedData value) native "glProgramUniformMatrix4fvEXT"; 610 | void glUseProgramStagesEXT(int pipeline, int stages, int program) 611 | native "glUseProgramStagesEXT"; 612 | void glValidateProgramPipelineEXT(int pipeline) 613 | native "glValidateProgramPipelineEXT"; 614 | void glProgramUniform1uiEXT(int program, int location, int v0) 615 | native "glProgramUniform1uiEXT"; 616 | void glProgramUniform2uiEXT(int program, int location, int v0, int v1) 617 | native "glProgramUniform2uiEXT"; 618 | void glProgramUniform3uiEXT(int program, int location, int v0, int v1, int v2) 619 | native "glProgramUniform3uiEXT"; 620 | void glProgramUniform4uiEXT(int program, int location, int v0, int v1, int v2, 621 | int v3) native "glProgramUniform4uiEXT"; 622 | void glProgramUniformMatrix2x3fvEXT(int program, int location, int count, 623 | int transpose, TypedData value) native "glProgramUniformMatrix2x3fvEXT"; 624 | void glProgramUniformMatrix3x2fvEXT(int program, int location, int count, 625 | int transpose, TypedData value) native "glProgramUniformMatrix3x2fvEXT"; 626 | void glProgramUniformMatrix2x4fvEXT(int program, int location, int count, 627 | int transpose, TypedData value) native "glProgramUniformMatrix2x4fvEXT"; 628 | void glProgramUniformMatrix4x2fvEXT(int program, int location, int count, 629 | int transpose, TypedData value) native "glProgramUniformMatrix4x2fvEXT"; 630 | void glProgramUniformMatrix3x4fvEXT(int program, int location, int count, 631 | int transpose, TypedData value) native "glProgramUniformMatrix3x4fvEXT"; 632 | void glProgramUniformMatrix4x3fvEXT(int program, int location, int count, 633 | int transpose, TypedData value) native "glProgramUniformMatrix4x3fvEXT"; 634 | void glFramebufferPixelLocalStorageSizeEXT(int target, int size) 635 | native "glFramebufferPixelLocalStorageSizeEXT"; 636 | int glGetFramebufferPixelLocalStorageSizeEXT(int target) 637 | native "glGetFramebufferPixelLocalStorageSizeEXT"; 638 | void glTexPageCommitmentEXT( 639 | int target, 640 | int level, 641 | int xoffset, 642 | int yoffset, 643 | int zoffset, 644 | int width, 645 | int height, 646 | int depth, 647 | int commit) native "glTexPageCommitmentEXT"; 648 | void glPatchParameteriEXT(int pname, int value) native "glPatchParameteriEXT"; 649 | void glTexBufferEXT(int target, int internalformat, int buffer) 650 | native "glTexBufferEXT"; 651 | void glTexBufferRangeEXT(int target, int internalformat, int buffer, int offset, 652 | int size) native "glTexBufferRangeEXT"; 653 | void glTexStorage1DEXT(int target, int levels, int internalformat, int width) 654 | native "glTexStorage1DEXT"; 655 | void glTexStorage2DEXT(int target, int levels, int internalformat, int width, 656 | int height) native "glTexStorage2DEXT"; 657 | void glTexStorage3DEXT(int target, int levels, int internalformat, int width, 658 | int height, int depth) native "glTexStorage3DEXT"; 659 | void glTextureStorage1DEXT(int texture, int target, int levels, 660 | int internalformat, int width) native "glTextureStorage1DEXT"; 661 | void glTextureStorage2DEXT(int texture, int target, int levels, 662 | int internalformat, int width, int height) native "glTextureStorage2DEXT"; 663 | void glTextureStorage3DEXT( 664 | int texture, 665 | int target, 666 | int levels, 667 | int internalformat, 668 | int width, 669 | int height, 670 | int depth) native "glTextureStorage3DEXT"; 671 | void glTextureViewEXT( 672 | int texture, 673 | int target, 674 | int origtexture, 675 | int internalformat, 676 | int minlevel, 677 | int numlevels, 678 | int minlayer, 679 | int numlayers) native "glTextureViewEXT"; 680 | void glFramebufferTexture2DDownsampleIMG( 681 | int target, 682 | int attachment, 683 | int textarget, 684 | int texture, 685 | int level, 686 | int xscale, 687 | int yscale) native "glFramebufferTexture2DDownsampleIMG"; 688 | void glFramebufferTextureLayerDownsampleIMG( 689 | int target, 690 | int attachment, 691 | int texture, 692 | int level, 693 | int layer, 694 | int xscale, 695 | int yscale) native "glFramebufferTextureLayerDownsampleIMG"; 696 | void glRenderbufferStorageMultisampleIMG( 697 | int target, 698 | int samples, 699 | int internalformat, 700 | int width, 701 | int height) native "glRenderbufferStorageMultisampleIMG"; 702 | void glFramebufferTexture2DMultisampleIMG( 703 | int target, 704 | int attachment, 705 | int textarget, 706 | int texture, 707 | int level, 708 | int samples) native "glFramebufferTexture2DMultisampleIMG"; 709 | void glApplyFramebufferAttachmentCMAAINTEL() 710 | native "glApplyFramebufferAttachmentCMAAINTEL"; 711 | void glBeginPerfQueryINTEL(int queryHandle) native "glBeginPerfQueryINTEL"; 712 | void glDeletePerfQueryINTEL(int queryHandle) native "glDeletePerfQueryINTEL"; 713 | void glEndPerfQueryINTEL(int queryHandle) native "glEndPerfQueryINTEL"; 714 | void glBlendParameteriNV(int pname, int value) native "glBlendParameteriNV"; 715 | void glBlendBarrierNV() native "glBlendBarrierNV"; 716 | void glBeginConditionalRenderNV(int id, int mode) 717 | native "glBeginConditionalRenderNV"; 718 | void glEndConditionalRenderNV() native "glEndConditionalRenderNV"; 719 | void glSubpixelPrecisionBiasNV(int xbits, int ybits) 720 | native "glSubpixelPrecisionBiasNV"; 721 | void glConservativeRasterParameteriNV(int pname, int param) 722 | native "glConservativeRasterParameteriNV"; 723 | void glCopyBufferSubDataNV(int readTarget, int writeTarget, int readOffset, 724 | int writeOffset, int size) native "glCopyBufferSubDataNV"; 725 | void glCoverageMaskNV(int mask) native "glCoverageMaskNV"; 726 | void glCoverageOperationNV(int operation) native "glCoverageOperationNV"; 727 | void glDrawArraysInstancedNV(int mode, int first, int count, int primcount) 728 | native "glDrawArraysInstancedNV"; 729 | void glDrawElementsInstancedNV(int mode, int count, int type, TypedData indices, 730 | int primcount) native "glDrawElementsInstancedNV"; 731 | void glDeleteFencesNV(List values) native "glDeleteFencesNV"; 732 | List glGenFencesNV(int n) native "glGenFencesNV"; 733 | bool glIsFenceNV(int fence) native "glIsFenceNV"; 734 | bool glTestFenceNV(int fence) native "glTestFenceNV"; 735 | void glFinishFenceNV(int fence) native "glFinishFenceNV"; 736 | void glSetFenceNV(int fence, int condition) native "glSetFenceNV"; 737 | void glFragmentCoverageColorNV(int color) native "glFragmentCoverageColorNV"; 738 | void glBlitFramebufferNV( 739 | int srcX0, 740 | int srcY0, 741 | int srcX1, 742 | int srcY1, 743 | int dstX0, 744 | int dstY0, 745 | int dstX1, 746 | int dstY1, 747 | int mask, 748 | int filter) native "glBlitFramebufferNV"; 749 | void glCoverageModulationTableNV(int n, TypedData v) 750 | native "glCoverageModulationTableNV"; 751 | void glCoverageModulationNV(int components) native "glCoverageModulationNV"; 752 | void glRenderbufferStorageMultisampleNV( 753 | int target, 754 | int samples, 755 | int internalformat, 756 | int width, 757 | int height) native "glRenderbufferStorageMultisampleNV"; 758 | void glVertexAttribDivisorNV(int index, int divisor) 759 | native "glVertexAttribDivisorNV"; 760 | void glUniformMatrix2x3fvNV(int location, int count, int transpose, 761 | TypedData value) native "glUniformMatrix2x3fvNV"; 762 | void glUniformMatrix3x2fvNV(int location, int count, int transpose, 763 | TypedData value) native "glUniformMatrix3x2fvNV"; 764 | void glUniformMatrix2x4fvNV(int location, int count, int transpose, 765 | TypedData value) native "glUniformMatrix2x4fvNV"; 766 | void glUniformMatrix4x2fvNV(int location, int count, int transpose, 767 | TypedData value) native "glUniformMatrix4x2fvNV"; 768 | void glUniformMatrix3x4fvNV(int location, int count, int transpose, 769 | TypedData value) native "glUniformMatrix3x4fvNV"; 770 | void glUniformMatrix4x3fvNV(int location, int count, int transpose, 771 | TypedData value) native "glUniformMatrix4x3fvNV"; 772 | int glGenPathsNV(int range) native "glGenPathsNV"; 773 | void glDeletePathsNV(int path, int range) native "glDeletePathsNV"; 774 | bool glIsPathNV(int path) native "glIsPathNV"; 775 | void glPathCoordsNV(int path, int numCoords, int coordType, TypedData coords) 776 | native "glPathCoordsNV"; 777 | void glPathSubCommandsNV( 778 | int path, 779 | int commandStart, 780 | int commandsToDelete, 781 | int numCommands, 782 | String commands, 783 | int numCoords, 784 | int coordType, 785 | TypedData coords) native "glPathSubCommandsNV"; 786 | void glPathSubCoordsNV(int path, int coordStart, int numCoords, int coordType, 787 | TypedData coords) native "glPathSubCoordsNV"; 788 | void glPathStringNV(int path, int format, int length, TypedData pathString) 789 | native "glPathStringNV"; 790 | void glPathGlyphsNV( 791 | int firstPathName, 792 | int fontTarget, 793 | TypedData fontName, 794 | int fontStyle, 795 | int numGlyphs, 796 | int type, 797 | TypedData charcodes, 798 | int handleMissingGlyphs, 799 | int pathParameterTemplate, 800 | double emScale) native "glPathGlyphsNV"; 801 | void glPathGlyphRangeNV( 802 | int firstPathName, 803 | int fontTarget, 804 | TypedData fontName, 805 | int fontStyle, 806 | int firstGlyph, 807 | int numGlyphs, 808 | int handleMissingGlyphs, 809 | int pathParameterTemplate, 810 | double emScale) native "glPathGlyphRangeNV"; 811 | void glCopyPathNV(int resultPath, int srcPath) native "glCopyPathNV"; 812 | void glInterpolatePathsNV(int resultPath, int pathA, int pathB, double weight) 813 | native "glInterpolatePathsNV"; 814 | void glPathParameterivNV(int path, int pname, TypedData value) 815 | native "glPathParameterivNV"; 816 | void glPathParameteriNV(int path, int pname, int value) 817 | native "glPathParameteriNV"; 818 | void glPathParameterfvNV(int path, int pname, TypedData value) 819 | native "glPathParameterfvNV"; 820 | void glPathParameterfNV(int path, int pname, double value) 821 | native "glPathParameterfNV"; 822 | void glPathStencilFuncNV(int func, int ref, int mask) 823 | native "glPathStencilFuncNV"; 824 | void glPathStencilDepthOffsetNV(double factor, double units) 825 | native "glPathStencilDepthOffsetNV"; 826 | void glStencilFillPathNV(int path, int fillMode, int mask) 827 | native "glStencilFillPathNV"; 828 | void glStencilStrokePathNV(int path, int reference, int mask) 829 | native "glStencilStrokePathNV"; 830 | void glPathCoverDepthFuncNV(int func) native "glPathCoverDepthFuncNV"; 831 | void glCoverFillPathNV(int path, int coverMode) native "glCoverFillPathNV"; 832 | void glCoverStrokePathNV(int path, int coverMode) native "glCoverStrokePathNV"; 833 | bool glIsPointInFillPathNV(int path, int mask, double x, double y) 834 | native "glIsPointInFillPathNV"; 835 | bool glIsPointInStrokePathNV(int path, double x, double y) 836 | native "glIsPointInStrokePathNV"; 837 | double glGetPathLengthNV(int path, int startSegment, int numSegments) 838 | native "glGetPathLengthNV"; 839 | void glStencilThenCoverFillPathNV(int path, int fillMode, int mask, 840 | int coverMode) native "glStencilThenCoverFillPathNV"; 841 | void glStencilThenCoverStrokePathNV(int path, int reference, int mask, 842 | int coverMode) native "glStencilThenCoverStrokePathNV"; 843 | int glPathGlyphIndexArrayNV( 844 | int firstPathName, 845 | int fontTarget, 846 | TypedData fontName, 847 | int fontStyle, 848 | int firstGlyphIndex, 849 | int numGlyphs, 850 | int pathParameterTemplate, 851 | double emScale) native "glPathGlyphIndexArrayNV"; 852 | int glPathMemoryGlyphIndexArrayNV( 853 | int firstPathName, 854 | int fontTarget, 855 | int fontSize, 856 | TypedData fontData, 857 | int faceIndex, 858 | int firstGlyphIndex, 859 | int numGlyphs, 860 | int pathParameterTemplate, 861 | double emScale) native "glPathMemoryGlyphIndexArrayNV"; 862 | void glPolygonModeNV(int face, int mode) native "glPolygonModeNV"; 863 | void glReadBufferNV(int mode) native "glReadBufferNV"; 864 | void glFramebufferSampleLocationsfvNV(int target, int start, int count, 865 | TypedData v) native "glFramebufferSampleLocationsfvNV"; 866 | void glNamedFramebufferSampleLocationsfvNV(int framebuffer, int start, 867 | int count, TypedData v) native "glNamedFramebufferSampleLocationsfvNV"; 868 | void glResolveDepthValuesNV() native "glResolveDepthValuesNV"; 869 | void glViewportArrayvNV(int first, int count, TypedData v) 870 | native "glViewportArrayvNV"; 871 | void glViewportIndexedfNV(int index, double x, double y, double w, double h) 872 | native "glViewportIndexedfNV"; 873 | void glViewportIndexedfvNV(int index, TypedData v) 874 | native "glViewportIndexedfvNV"; 875 | void glScissorArrayvNV(int first, int count, TypedData v) 876 | native "glScissorArrayvNV"; 877 | void glScissorIndexedNV(int index, int left, int bottom, int width, int height) 878 | native "glScissorIndexedNV"; 879 | void glScissorIndexedvNV(int index, TypedData v) native "glScissorIndexedvNV"; 880 | void glDepthRangeArrayfvNV(int first, int count, TypedData v) 881 | native "glDepthRangeArrayfvNV"; 882 | void glDepthRangeIndexedfNV(int index, double n, double f) 883 | native "glDepthRangeIndexedfNV"; 884 | void glEnableiNV(int target, int index) native "glEnableiNV"; 885 | void glDisableiNV(int target, int index) native "glDisableiNV"; 886 | bool glIsEnablediNV(int target, int index) native "glIsEnablediNV"; 887 | void glViewportSwizzleNV(int index, int swizzlex, int swizzley, int swizzlez, 888 | int swizzlew) native "glViewportSwizzleNV"; 889 | void glFramebufferTextureMultiviewOVR( 890 | int target, 891 | int attachment, 892 | int texture, 893 | int level, 894 | int baseViewIndex, 895 | int numViews) native "glFramebufferTextureMultiviewOVR"; 896 | void glFramebufferTextureMultisampleMultiviewOVR( 897 | int target, 898 | int attachment, 899 | int texture, 900 | int level, 901 | int samples, 902 | int baseViewIndex, 903 | int numViews) native "glFramebufferTextureMultisampleMultiviewOVR"; 904 | void glAlphaFuncQCOM(int func, double ref) native "glAlphaFuncQCOM"; 905 | void glEnableDriverControlQCOM(int driverControl) 906 | native "glEnableDriverControlQCOM"; 907 | void glDisableDriverControlQCOM(int driverControl) 908 | native "glDisableDriverControlQCOM"; 909 | void glExtTexObjectStateOverrideiQCOM(int target, int pname, int param) 910 | native "glExtTexObjectStateOverrideiQCOM"; 911 | bool glExtIsProgramBinaryQCOM(int program) native "glExtIsProgramBinaryQCOM"; 912 | void glFramebufferFoveationParametersQCOM( 913 | int framebuffer, 914 | int layer, 915 | int focalPoint, 916 | double focalX, 917 | double focalY, 918 | double gainX, 919 | double gainY, 920 | double foveaArea) native "glFramebufferFoveationParametersQCOM"; 921 | void glFramebufferFetchBarrierQCOM() native "glFramebufferFetchBarrierQCOM"; 922 | void glStartTilingQCOM(int x, int y, int width, int height, int preserveMask) 923 | native "glStartTilingQCOM"; 924 | void glEndTilingQCOM(int preserveMask) native "glEndTilingQCOM"; 925 | -------------------------------------------------------------------------------- /lib/src/gl_extension.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | #include 7 | 8 | #include "dart_api.h" 9 | 10 | #include "generated/function_list.h" 11 | #include "generated/gl_bindings.h" 12 | #include "gl_extension.h" 13 | #include "gl_extension_info.h" 14 | #include "manual_bindings.h" 15 | #include "util.h" 16 | 17 | DART_EXPORT Dart_Handle gl_extension_Init(Dart_Handle parent_library) { 18 | if (Dart_IsError(parent_library)) { 19 | return parent_library; 20 | } 21 | 22 | Dart_Handle result_code = 23 | Dart_SetNativeResolver(parent_library, ResolveName, NULL); 24 | if (Dart_IsError(result_code)) { 25 | return result_code; 26 | } 27 | 28 | // Look up the GL library and stash it in the info for this isolate. 29 | auto gl_lib = HandleError(Dart_NewPersistentHandle(HandleError( 30 | Dart_LookupLibrary(Dart_NewStringFromCString("package:gl/gl.dart"))))); 31 | auto core_lib = HandleError(Dart_NewPersistentHandle( 32 | HandleError(Dart_LookupLibrary(Dart_NewStringFromCString("dart:core"))))); 33 | 34 | GlExtensionInfo::create(gl_lib, core_lib); 35 | 36 | loadFunctions(); 37 | 38 | return Dart_Null(); 39 | } 40 | 41 | Dart_NativeFunction ResolveName(Dart_Handle name, int argc, 42 | bool* auto_setup_scope) { 43 | if (!Dart_IsString(name)) { 44 | return NULL; 45 | } 46 | Dart_NativeFunction result = NULL; 47 | 48 | const char* cname; 49 | HandleError(Dart_StringToCString(name, &cname)); 50 | 51 | for (int i = 0; function_list[i].name != NULL; ++i) { 52 | if (strcmp(function_list[i].name, cname) == 0) { 53 | result = function_list[i].function; 54 | break; 55 | } 56 | } 57 | return result; 58 | } 59 | -------------------------------------------------------------------------------- /lib/src/gl_extension.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | #ifndef DART_GL_LIB_SRC_GL_EXTENSION_H_ 7 | #define DART_GL_LIB_SRC_GL_EXTENSION_H_ 8 | 9 | #include "dart_api.h" 10 | 11 | Dart_NativeFunction ResolveName(Dart_Handle name, int argc, 12 | bool* auto_setup_scope); 13 | 14 | DART_EXPORT Dart_Handle gl_extension_Init(Dart_Handle parent_library); 15 | 16 | #endif // DART_GL_LIB_SRC_GL_EXTENSION_H_ 17 | -------------------------------------------------------------------------------- /lib/src/gl_extension_info.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | #include "gl_extension_info.h" 7 | 8 | // Create GlExtensionInfo for each new library instance. 9 | void GlExtensionInfo::create(Dart_Handle gl_library, Dart_Handle core_library) { 10 | std::lock_guard guard(info_for_isolate_mutex_); 11 | info_for_isolate_[Dart_CurrentIsolate()] = 12 | new GlExtensionInfo(gl_library, core_library); 13 | } 14 | 15 | // Query GlExtensionInfo for the current context. 16 | GlExtensionInfo& GlExtensionInfo::current() { 17 | return *info_for_isolate_.at(Dart_CurrentIsolate()); 18 | } 19 | 20 | GlExtensionInfo::GlExtensionInfo(Dart_Handle gl_library, 21 | Dart_Handle core_library) 22 | : gl_library_(gl_library), core_library_(core_library) {} 23 | 24 | std::map GlExtensionInfo::info_for_isolate_; 25 | std::mutex GlExtensionInfo::info_for_isolate_mutex_; 26 | -------------------------------------------------------------------------------- /lib/src/gl_extension_info.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | #ifndef DART_GL_LIB_SRC_GL_EXTENSION_INFO_H_ 7 | #define DART_GL_LIB_SRC_GL_EXTENSION_INFO_H_ 8 | 9 | #include 10 | #include 11 | 12 | #include "dart_api.h" 13 | 14 | // Extra data needed for this extension in each isolate. 15 | class GlExtensionInfo { 16 | public: 17 | static void create(Dart_Handle gl_library, Dart_Handle core_library); 18 | 19 | // Returns extra info associated with this library for the Dart isolate 20 | // in which it is executing. 21 | static GlExtensionInfo& current(); 22 | 23 | const Dart_Handle& gl_library() const { return gl_library_; } 24 | const Dart_Handle& core_library() const { return core_library_; } 25 | 26 | private: 27 | GlExtensionInfo(Dart_Handle gl_library, Dart_Handle core_library); 28 | 29 | // Info unique to this isolate: 30 | Dart_Handle gl_library_; 31 | Dart_Handle core_library_; 32 | 33 | static std::map info_for_isolate_; 34 | static std::mutex info_for_isolate_mutex_; 35 | }; 36 | 37 | #endif // DART_GL_LIB_SRC_GL_EXTENSION_INFO_H_ 38 | -------------------------------------------------------------------------------- /lib/src/instantiate_gl_classes.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | // Functions to instantiate GL-specific classes from the C extension. 7 | // Most of these classes are designed to mirror the WebGL interface. 8 | 9 | #include 10 | 11 | #include 12 | #include "dart_api.h" 13 | 14 | #include "gl_extension.h" 15 | #include "gl_extension_info.h" 16 | #include "instantiate_gl_classes.h" 17 | #include "util.h" 18 | 19 | Dart_Handle NewActiveInfo(GLint size, GLenum type, GLchar* name) { 20 | auto info = GlExtensionInfo::current(); 21 | Dart_Handle ActiveInfo_type = HandleError(Dart_GetType( 22 | info.gl_library(), Dart_NewStringFromCString("ActiveInfo"), 0, NULL)); 23 | 24 | const int num_arguments = 3; 25 | Dart_Handle arguments[num_arguments]; 26 | arguments[0] = Dart_NewInteger(size); 27 | arguments[1] = Dart_NewInteger(type); 28 | arguments[2] = Dart_NewStringFromCString(name); 29 | 30 | return Dart_New(ActiveInfo_type, Dart_Null(), num_arguments, arguments); 31 | } 32 | 33 | Dart_Handle NewShaderPrecisionFormat(GLint* range, GLint precision) { 34 | auto info = GlExtensionInfo::current(); 35 | Dart_Handle ShaderPrecisionFormat_type = HandleError(Dart_GetType( 36 | info.gl_library(), Dart_NewStringFromCString("ShaderPrecisionFormat"), 0, 37 | NULL)); 38 | 39 | const int num_arguments = 3; 40 | Dart_Handle arguments[num_arguments]; 41 | arguments[0] = Dart_NewInteger(range[0]); 42 | arguments[1] = Dart_NewInteger(range[1]); 43 | arguments[2] = Dart_NewInteger(precision); 44 | 45 | return Dart_New(ShaderPrecisionFormat_type, Dart_Null(), num_arguments, 46 | arguments); 47 | } 48 | -------------------------------------------------------------------------------- /lib/src/instantiate_gl_classes.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | #ifndef DART_GL_LIB_SRC_INSTANTIATE_GL_CLASSES_H_ 7 | #define DART_GL_LIB_SRC_INSTANTIATE_GL_CLASSES_H_ 8 | 9 | #include 10 | #include "dart_api.h" 11 | 12 | Dart_Handle NewActiveInfo(GLint size, GLenum type, GLchar* name); 13 | Dart_Handle NewShaderPrecisionFormat(GLint* range, GLint precision); 14 | 15 | #endif // DART_GL_LIB_SRC_INSTANTIATE_GL_CLASSES_H_ 16 | -------------------------------------------------------------------------------- /lib/src/manual_bindings.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | #include 7 | 8 | #include 9 | #include "dart_api.h" 10 | 11 | #include "gl_extension_info.h" 12 | #include "instantiate_gl_classes.h" 13 | #include "manual_bindings.h" 14 | #include "util.h" 15 | 16 | // This file contains native extension functions which have to be manually 17 | // written due to the corresponding C functions returning values via pointer 18 | // arguments or taking Dart Lists as arguments that need to be parsed to C 19 | // arrays. 20 | 21 | void glGetActiveAttrib_native(Dart_NativeArguments arguments) { 22 | TRACE_START(glGetActiveAttrib_); 23 | Dart_Handle program_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 24 | 25 | int64_t program = 0; 26 | HANDLE(Dart_IntegerToInt64(program_obj, &program)); 27 | 28 | Dart_Handle index_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 29 | 30 | int64_t index = 0; 31 | HANDLE(Dart_IntegerToInt64(index_obj, &index)); 32 | 33 | GLsizei bufSize; 34 | glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &bufSize); 35 | 36 | GLint size; 37 | GLenum type; 38 | GLchar *name = static_cast(malloc(sizeof(GLchar) * bufSize)); 39 | glGetActiveAttrib(program, index, bufSize, NULL, &size, &type, name); 40 | 41 | Dart_SetReturnValue(arguments, HANDLE(NewActiveInfo(size, type, name))); 42 | free(name); 43 | TRACE_END(glGetActiveAttrib_); 44 | } 45 | 46 | void glGetActiveUniform_native(Dart_NativeArguments arguments) { 47 | TRACE_START(glGetActiveUniform_); 48 | Dart_Handle program_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 49 | 50 | int64_t program = 0; 51 | HANDLE(Dart_IntegerToInt64(program_obj, &program)); 52 | 53 | Dart_Handle index_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 54 | 55 | int64_t index = 0; 56 | HANDLE(Dart_IntegerToInt64(index_obj, &index)); 57 | 58 | GLsizei bufSize; 59 | glGetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &bufSize); 60 | 61 | GLint size; 62 | GLenum type; 63 | GLchar *name = static_cast(malloc(sizeof(GLchar) * bufSize)); 64 | glGetActiveUniform(program, index, bufSize, NULL, &size, &type, name); 65 | 66 | Dart_SetReturnValue(arguments, HANDLE(NewActiveInfo(size, type, name))); 67 | free(name); 68 | TRACE_END(glGetActiveUniform_); 69 | } 70 | 71 | void glGetAttachedShaders_native(Dart_NativeArguments arguments) { 72 | TRACE_START(glGetAttachedShaders_); 73 | Dart_Handle program_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 74 | 75 | int64_t program = 0; 76 | HANDLE(Dart_IntegerToInt64(program_obj, &program)); 77 | 78 | GLsizei maxCount; 79 | glGetProgramiv(program, GL_ATTACHED_SHADERS, &maxCount); 80 | GLuint *shaders = static_cast(malloc(sizeof(GLuint) * maxCount)); 81 | 82 | glGetAttachedShaders(program, maxCount, NULL, shaders); 83 | 84 | Dart_Handle shaders_obj = Dart_NewListOf(Dart_CoreType_Int, maxCount); 85 | for (int i = 0; i < maxCount; i++) { 86 | Dart_ListSetAt(shaders_obj, i, Dart_NewInteger(shaders[i])); 87 | } 88 | Dart_SetReturnValue(arguments, shaders_obj); 89 | TRACE_END(glGetAttachedShaders_); 90 | } 91 | 92 | void glGetBooleanv_native(Dart_NativeArguments arguments) { 93 | TRACE_START(glGetBooleanv_); 94 | int64_t pname = 0; 95 | HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &pname)); 96 | 97 | int length = GetGlGetResultLength(pname); 98 | 99 | auto core_lib = GlExtensionInfo::current().core_library(); 100 | Dart_Handle bool_type = HandleError( 101 | Dart_GetType(core_lib, Dart_NewStringFromCString("bool"), 0, nullptr)); 102 | Dart_Handle list; 103 | if (length > 0) { 104 | list = HANDLE(Dart_NewListOfType(bool_type, length)); 105 | GLboolean *data = (GLboolean *)malloc(sizeof(GLboolean) * length); 106 | glGetBooleanv(pname, data); 107 | for (int i = 0; i < length; i++) { 108 | Dart_Handle item = HANDLE(Dart_NewBoolean((bool)data[i])); 109 | HANDLE(Dart_ListSetAt(list, (intptr_t)i, item)); 110 | } 111 | free(data); 112 | } else { 113 | list = HANDLE(Dart_NewListOfType(bool_type, 0)); 114 | } 115 | Dart_SetReturnValue(arguments, list); 116 | TRACE_END(glGetBooleanv_); 117 | } 118 | 119 | void glGetBufferParameteriv_native(Dart_NativeArguments arguments) { 120 | TRACE_START(glGetBufferParameteriv_); 121 | Dart_Handle target_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 122 | 123 | int64_t target = 0; 124 | HANDLE(Dart_IntegerToInt64(target_obj, &target)); 125 | 126 | Dart_Handle pname_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 127 | 128 | int64_t pname = 0; 129 | HANDLE(Dart_IntegerToInt64(pname_obj, &pname)); 130 | 131 | GLint params; 132 | glGetBufferParameteriv(target, pname, ¶ms); 133 | Dart_SetReturnValue(arguments, HANDLE(Dart_NewInteger(params))); 134 | TRACE_END(glGetBufferParameteriv_); 135 | } 136 | 137 | void glGetFloatv_native(Dart_NativeArguments arguments) { 138 | TRACE_START(glGetFloatv_); 139 | int64_t pname = 0; 140 | HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &pname)); 141 | 142 | int length = GetGlGetResultLength(pname); 143 | 144 | auto core_lib = GlExtensionInfo::current().core_library(); 145 | Dart_Handle double_type = HandleError( 146 | Dart_GetType(core_lib, Dart_NewStringFromCString("double"), 0, nullptr)); 147 | Dart_Handle list; 148 | if (length > 0) { 149 | list = HANDLE(Dart_NewListOfType(double_type, length)); 150 | GLfloat *data = (GLfloat *)malloc(sizeof(GLfloat) * length); 151 | glGetFloatv(pname, data); 152 | for (int i = 0; i < length; i++) { 153 | Dart_Handle item = HANDLE(Dart_NewDouble((double)data[i])); 154 | HANDLE(Dart_ListSetAt(list, (intptr_t)i, item)); 155 | } 156 | free(data); 157 | } else { 158 | list = HANDLE(Dart_NewListOfType(double_type, 0)); 159 | } 160 | Dart_SetReturnValue(arguments, list); 161 | TRACE_END(glGetFloatv_); 162 | } 163 | 164 | void glGetFramebufferAttachmentParameteriv_native( 165 | Dart_NativeArguments arguments) { 166 | TRACE_START(glGetFramebufferAttachmentParameteriv_); 167 | Dart_Handle target_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 168 | 169 | int64_t target = 0; 170 | HANDLE(Dart_IntegerToInt64(target_obj, &target)); 171 | 172 | Dart_Handle attachment_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 173 | 174 | int64_t attachment = 0; 175 | HANDLE(Dart_IntegerToInt64(attachment_obj, &attachment)); 176 | 177 | Dart_Handle pname_obj = HANDLE(Dart_GetNativeArgument(arguments, 2)); 178 | 179 | int64_t pname = 0; 180 | HANDLE(Dart_IntegerToInt64(pname_obj, &pname)); 181 | 182 | GLint params; 183 | glGetFramebufferAttachmentParameteriv(target, attachment, pname, ¶ms); 184 | Dart_SetReturnValue(arguments, HANDLE(Dart_NewInteger(params))); 185 | TRACE_END(glGetFramebufferAttachmentParameteriv_); 186 | } 187 | 188 | void glGetIntegerv_native(Dart_NativeArguments arguments) { 189 | TRACE_START(glGetIntegerv_); 190 | int64_t pname = 0; 191 | HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &pname)); 192 | 193 | int length = GetGlGetResultLength(pname); 194 | 195 | Dart_Handle list; 196 | if (length > 0) { 197 | list = HANDLE(Dart_NewListOf(Dart_CoreType_Int, length)); 198 | GLint *data = (GLint *)malloc(sizeof(GLint) * length); 199 | glGetIntegerv(pname, data); 200 | for (int i = 0; i < length; i++) { 201 | Dart_Handle item = HANDLE(Dart_NewInteger((int64_t)data[i])); 202 | HANDLE(Dart_ListSetAt(list, (intptr_t)i, item)); 203 | } 204 | free(data); 205 | } else { 206 | list = HANDLE(Dart_NewListOf(Dart_CoreType_Int, 0)); 207 | } 208 | Dart_SetReturnValue(arguments, list); 209 | TRACE_END(glGetIntegerv_); 210 | } 211 | 212 | void glGetProgramiv_native(Dart_NativeArguments arguments) { 213 | TRACE_START(glGetProgramiv_); 214 | Dart_Handle program_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 215 | 216 | int64_t program = 0; 217 | HANDLE(Dart_IntegerToInt64(program_obj, &program)); 218 | 219 | Dart_Handle pname_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 220 | 221 | int64_t pname = 0; 222 | HANDLE(Dart_IntegerToInt64(pname_obj, &pname)); 223 | 224 | GLint params; 225 | glGetProgramiv(program, pname, ¶ms); 226 | 227 | Dart_SetReturnValue(arguments, Dart_NewInteger(params)); 228 | TRACE_END(glGetProgramiv_); 229 | } 230 | 231 | void glGetProgramInfoLog_native(Dart_NativeArguments arguments) { 232 | TRACE_START(glGetProgramInfoLog_); 233 | Dart_Handle program_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 234 | 235 | int64_t program = 0; 236 | HANDLE(Dart_IntegerToInt64(program_obj, &program)); 237 | 238 | GLsizei maxSize; 239 | glGetProgramiv(program, GL_INFO_LOG_LENGTH, &maxSize); 240 | 241 | char *infoLog = static_cast(malloc(sizeof(char) * maxSize)); 242 | glGetProgramInfoLog(program, maxSize, NULL, infoLog); 243 | 244 | Dart_SetReturnValue(arguments, HANDLE(Dart_NewStringFromCString(infoLog))); 245 | free(infoLog); 246 | TRACE_END(glGetProgramInfoLog_); 247 | } 248 | 249 | void glGetRenderbufferParameteriv_native(Dart_NativeArguments arguments) { 250 | TRACE_START(glGetProgramInfoLog_); 251 | Dart_Handle target_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 252 | 253 | int64_t target = 0; 254 | HANDLE(Dart_IntegerToInt64(target_obj, &target)); 255 | 256 | Dart_Handle pname_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 257 | 258 | int64_t pname = 0; 259 | HANDLE(Dart_IntegerToInt64(pname_obj, &pname)); 260 | 261 | GLint params; 262 | glGetRenderbufferParameteriv(target, pname, ¶ms); 263 | Dart_SetReturnValue(arguments, HANDLE(Dart_NewInteger(params))); 264 | TRACE_END(glGetProgramInfoLog_); 265 | } 266 | 267 | void glGetShaderiv_native(Dart_NativeArguments arguments) { 268 | TRACE_START(glGetShaderiv_); 269 | Dart_Handle shader_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 270 | 271 | int64_t shader = 0; 272 | HANDLE(Dart_IntegerToInt64(shader_obj, &shader)); 273 | 274 | Dart_Handle pname_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 275 | 276 | int64_t pname = 0; 277 | HANDLE(Dart_IntegerToInt64(pname_obj, &pname)); 278 | 279 | GLint params; 280 | glGetShaderiv(shader, pname, ¶ms); 281 | 282 | Dart_SetReturnValue(arguments, Dart_NewInteger(params)); 283 | TRACE_END(glGetShaderiv_); 284 | } 285 | 286 | void glGetShaderInfoLog_native(Dart_NativeArguments arguments) { 287 | TRACE_START(glGetShaderInfoLog_); 288 | Dart_Handle shader_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 289 | 290 | int64_t shader = 0; 291 | HANDLE(Dart_IntegerToInt64(shader_obj, &shader)); 292 | 293 | GLsizei bufSize; 294 | glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &bufSize); 295 | 296 | char *infoLog = static_cast(malloc(sizeof(char) * bufSize)); 297 | glGetShaderInfoLog(shader, bufSize, NULL, infoLog); 298 | 299 | Dart_SetReturnValue(arguments, HANDLE(Dart_NewStringFromCString(infoLog))); 300 | free(infoLog); 301 | TRACE_END(glGetShaderInfoLog_); 302 | } 303 | 304 | void glGetShaderPrecisionFormat_native(Dart_NativeArguments arguments) { 305 | TRACE_START(glGetShaderPrecisionFormat_); 306 | Dart_Handle shadertype_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 307 | 308 | int64_t shadertype = 0; 309 | HANDLE(Dart_IntegerToInt64(shadertype_obj, &shadertype)); 310 | 311 | Dart_Handle precisiontype_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 312 | 313 | int64_t precisiontype = 0; 314 | HANDLE(Dart_IntegerToInt64(precisiontype_obj, &precisiontype)); 315 | 316 | GLint range[2] = {0, 0}; 317 | GLint precision = 0; 318 | 319 | glGetShaderPrecisionFormat(shadertype, precisiontype, range, &precision); 320 | 321 | Dart_SetReturnValue(arguments, 322 | HANDLE(NewShaderPrecisionFormat(range, precision))); 323 | TRACE_END(glGetShaderPrecisionFormat_); 324 | } 325 | 326 | void glGetShaderSource_native(Dart_NativeArguments arguments) { 327 | TRACE_START(glGetShaderSource_); 328 | Dart_Handle shader_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 329 | 330 | int64_t shader = 0; 331 | HANDLE(Dart_IntegerToInt64(shader_obj, &shader)); 332 | 333 | GLint bufSize; 334 | glGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &bufSize); 335 | 336 | char *source = static_cast(malloc(sizeof(char) * bufSize)); 337 | GLsizei length; 338 | glGetShaderSource(shader, bufSize, &length, source); 339 | 340 | Dart_SetReturnValue(arguments, HANDLE(Dart_NewStringFromCString(source))); 341 | free(source); 342 | TRACE_END(glGetShaderSource_); 343 | } 344 | 345 | void glGetTexParameterfv_native(Dart_NativeArguments arguments) { 346 | TRACE_START(glGetTexParameterfv_); 347 | Dart_Handle target_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 348 | 349 | int64_t target = 0; 350 | HANDLE(Dart_IntegerToInt64(target_obj, &target)); 351 | 352 | Dart_Handle pname_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 353 | 354 | int64_t pname = 0; 355 | HANDLE(Dart_IntegerToInt64(pname_obj, &pname)); 356 | 357 | GLfloat params; 358 | glGetTexParameterfv(target, pname, ¶ms); 359 | 360 | Dart_SetReturnValue(arguments, HANDLE(Dart_NewDouble(params))); 361 | TRACE_END(glGetTexParameterfv_); 362 | } 363 | 364 | void glGetTexParameteriv_native(Dart_NativeArguments arguments) { 365 | TRACE_START(glGetTexParameteriv_); 366 | Dart_Handle target_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 367 | 368 | int64_t target = 0; 369 | HANDLE(Dart_IntegerToInt64(target_obj, &target)); 370 | 371 | Dart_Handle pname_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 372 | 373 | int64_t pname = 0; 374 | HANDLE(Dart_IntegerToInt64(pname_obj, &pname)); 375 | 376 | GLint params; 377 | glGetTexParameteriv(target, pname, ¶ms); 378 | 379 | Dart_SetReturnValue(arguments, HANDLE(Dart_NewInteger(params))); 380 | TRACE_END(glGetTexParameteriv_); 381 | } 382 | 383 | void glGetUniformfv_native(Dart_NativeArguments arguments) { 384 | TRACE_START(glGetTexParameteriv_); 385 | Dart_Handle program_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 386 | 387 | int64_t program = 0; 388 | HANDLE(Dart_IntegerToInt64(program_obj, &program)); 389 | Dart_Handle location_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 390 | 391 | int64_t location = 0; 392 | HANDLE(Dart_IntegerToInt64(location_obj, &location)); 393 | 394 | GLfloat params; 395 | glGetUniformfv(program, location, ¶ms); 396 | Dart_SetReturnValue(arguments, HANDLE(Dart_NewDouble(params))); 397 | TRACE_END(glGetTexParameteriv_); 398 | } 399 | 400 | void glGetUniformiv_native(Dart_NativeArguments arguments) { 401 | TRACE_START(glGetUniformiv_); 402 | Dart_Handle program_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 403 | 404 | int64_t program = 0; 405 | HANDLE(Dart_IntegerToInt64(program_obj, &program)); 406 | 407 | Dart_Handle location_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 408 | 409 | int64_t location = 0; 410 | HANDLE(Dart_IntegerToInt64(location_obj, &location)); 411 | 412 | GLint params; 413 | glGetUniformiv(program, location, ¶ms); 414 | Dart_SetReturnValue(arguments, HANDLE(Dart_NewInteger(params))); 415 | TRACE_END(glGetUniformiv_); 416 | } 417 | 418 | void glGetVertexAttribfv_native(Dart_NativeArguments arguments) { 419 | TRACE_START(glGetVertexAttribfv_); 420 | Dart_Handle index_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 421 | 422 | int64_t index = 0; 423 | HANDLE(Dart_IntegerToInt64(index_obj, &index)); 424 | 425 | Dart_Handle pname_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 426 | 427 | int64_t pname = 0; 428 | HANDLE(Dart_IntegerToInt64(pname_obj, &pname)); 429 | 430 | GLfloat params; 431 | glGetVertexAttribfv(index, pname, ¶ms); 432 | 433 | Dart_SetReturnValue(arguments, HANDLE(Dart_NewDouble(params))); 434 | TRACE_END(glGetVertexAttribfv_); 435 | } 436 | 437 | void glGetVertexAttribiv_native(Dart_NativeArguments arguments) { 438 | TRACE_START(glGetVertexAttribiv_); 439 | Dart_Handle index_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 440 | 441 | int64_t index = 0; 442 | HANDLE(Dart_IntegerToInt64(index_obj, &index)); 443 | 444 | Dart_Handle pname_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 445 | 446 | int64_t pname = 0; 447 | HANDLE(Dart_IntegerToInt64(pname_obj, &pname)); 448 | 449 | GLint params; 450 | glGetVertexAttribiv(index, pname, ¶ms); 451 | Dart_SetReturnValue(arguments, HANDLE(Dart_NewInteger(params))); 452 | TRACE_END(glGetVertexAttribiv_); 453 | } 454 | 455 | void glGetVertexAttribPointerv_native(Dart_NativeArguments arguments) { 456 | TRACE_START(glGetVertexAttribPointerv_); 457 | Dart_Handle index_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 458 | 459 | int64_t index = 0; 460 | HANDLE(Dart_IntegerToInt64(index_obj, &index)); 461 | 462 | Dart_Handle pname_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 463 | 464 | int64_t pname = 0; 465 | HANDLE(Dart_IntegerToInt64(pname_obj, &pname)); 466 | 467 | GLvoid *pointer; 468 | glGetVertexAttribPointerv(index, pname, &pointer); 469 | 470 | Dart_SetReturnValue( 471 | arguments, HANDLE(Dart_NewInteger(reinterpret_cast(pointer)))); 472 | TRACE_END(glGetVertexAttribPointerv_); 473 | } 474 | 475 | void glReadPixels_native(Dart_NativeArguments arguments) { 476 | TRACE_START(glReadPixels_); 477 | Dart_Handle x_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 478 | 479 | int64_t x = 0; 480 | HANDLE(Dart_IntegerToInt64(x_obj, &x)); 481 | 482 | Dart_Handle y_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 483 | 484 | int64_t y = 0; 485 | HANDLE(Dart_IntegerToInt64(y_obj, &y)); 486 | 487 | Dart_Handle width_obj = HANDLE(Dart_GetNativeArgument(arguments, 2)); 488 | 489 | int64_t width = 0; 490 | HANDLE(Dart_IntegerToInt64(width_obj, &width)); 491 | 492 | Dart_Handle height_obj = HANDLE(Dart_GetNativeArgument(arguments, 3)); 493 | 494 | int64_t height = 0; 495 | HANDLE(Dart_IntegerToInt64(height_obj, &height)); 496 | 497 | Dart_Handle format_obj = HANDLE(Dart_GetNativeArgument(arguments, 4)); 498 | 499 | int64_t format = 0; 500 | HANDLE(Dart_IntegerToInt64(format_obj, &format)); 501 | 502 | Dart_Handle type_obj = HANDLE(Dart_GetNativeArgument(arguments, 5)); 503 | 504 | int64_t type = 0; 505 | HANDLE(Dart_IntegerToInt64(type_obj, &type)); 506 | 507 | Dart_Handle pixels_obj = HANDLE(Dart_GetNativeArgument(arguments, 6)); 508 | 509 | void *pixels_data = NULL; 510 | Dart_TypedData_Type pixels_typeddata_type = Dart_TypedData_kInvalid; 511 | intptr_t pixels_typeddata_length = 0; 512 | if (!Dart_IsNull(pixels_obj)) { 513 | HANDLE(Dart_TypedDataAcquireData(pixels_obj, &pixels_typeddata_type, 514 | &pixels_data, &pixels_typeddata_length)); 515 | } 516 | void *pixels = static_cast(pixels_data); 517 | 518 | glReadPixels(x, y, width, height, format, type, pixels); 519 | 520 | if (!Dart_IsNull(pixels_obj)) { 521 | Dart_TypedDataReleaseData(pixels_obj); 522 | } 523 | TRACE_END(glReadPixels_); 524 | } 525 | 526 | void glShaderSource_native(Dart_NativeArguments arguments) { 527 | TRACE_START(glShaderSource_); 528 | Dart_Handle shader_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 529 | 530 | int64_t shader = 0; 531 | HANDLE(Dart_IntegerToInt64(shader_obj, &shader)); 532 | 533 | Dart_Handle string_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 534 | 535 | const char *string = NULL; 536 | HANDLE(Dart_StringToCString(string_obj, &string)); 537 | 538 | glShaderSource(shader, 1, &string, NULL); 539 | TRACE_END(glShaderSource_); 540 | } 541 | 542 | void glTexParameterfv_native(Dart_NativeArguments arguments) { 543 | TRACE_START(glTexParameterfv_); 544 | Dart_Handle target_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 545 | 546 | int64_t target = 0; 547 | HANDLE(Dart_IntegerToInt64(target_obj, &target)); 548 | 549 | Dart_Handle pname_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 550 | 551 | int64_t pname = 0; 552 | HANDLE(Dart_IntegerToInt64(pname_obj, &pname)); 553 | 554 | Dart_Handle params_obj = HANDLE(Dart_GetNativeArgument(arguments, 2)); 555 | GLfloat *params = NULL; 556 | if (!Dart_IsNull(params_obj)) { 557 | intptr_t length; 558 | HANDLE(Dart_ListLength(params_obj, &length)); 559 | 560 | params = static_cast(malloc(sizeof(GLfloat) * length)); 561 | 562 | for (int i = 0; i < length; i++) { 563 | double ith; 564 | HANDLE(Dart_DoubleValue(HANDLE(Dart_ListGetAt(params_obj, i)), &ith)); 565 | params[i] = static_cast(ith); 566 | } 567 | } 568 | glTexParameterfv(target, pname, params); 569 | free(params); 570 | TRACE_END(glTexParameterfv_); 571 | } 572 | 573 | void glTexParameteriv_native(Dart_NativeArguments arguments) { 574 | TRACE_START(glTexParameteriv_); 575 | Dart_Handle target_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 576 | 577 | int64_t target = 0; 578 | HANDLE(Dart_IntegerToInt64(target_obj, &target)); 579 | 580 | Dart_Handle pname_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 581 | 582 | int64_t pname = 0; 583 | HANDLE(Dart_IntegerToInt64(pname_obj, &pname)); 584 | 585 | Dart_Handle params_obj = HANDLE(Dart_GetNativeArgument(arguments, 2)); 586 | GLint *params = NULL; 587 | if (!Dart_IsNull(params_obj)) { 588 | intptr_t length; 589 | HANDLE(Dart_ListLength(params_obj, &length)); 590 | 591 | params = static_cast(malloc(sizeof(GLint) * length)); 592 | 593 | for (int i = 0; i < length; i++) { 594 | int64_t ith; 595 | HANDLE(Dart_IntegerToInt64(HANDLE(Dart_ListGetAt(params_obj, i)), &ith)); 596 | params[i] = static_cast(ith); 597 | } 598 | } 599 | glTexParameteriv(target, pname, params); 600 | free(params); 601 | TRACE_END(glTexParameteriv_); 602 | } 603 | 604 | void glVertexAttribPointer_native(Dart_NativeArguments arguments) { 605 | TRACE_START(glVertexAttribPointer_); 606 | Dart_Handle index_obj = HANDLE(Dart_GetNativeArgument(arguments, 0)); 607 | 608 | int64_t index = 0; 609 | HANDLE(Dart_IntegerToInt64(index_obj, &index)); 610 | 611 | Dart_Handle size_obj = HANDLE(Dart_GetNativeArgument(arguments, 1)); 612 | 613 | int64_t size = 0; 614 | HANDLE(Dart_IntegerToInt64(size_obj, &size)); 615 | 616 | Dart_Handle type_obj = HANDLE(Dart_GetNativeArgument(arguments, 2)); 617 | 618 | int64_t type = 0; 619 | HANDLE(Dart_IntegerToInt64(type_obj, &type)); 620 | 621 | Dart_Handle normalized_obj = HANDLE(Dart_GetNativeArgument(arguments, 3)); 622 | 623 | bool normalized = 0; 624 | HANDLE(Dart_BooleanValue(normalized_obj, &normalized)); 625 | 626 | Dart_Handle stride_obj = HANDLE(Dart_GetNativeArgument(arguments, 4)); 627 | 628 | int64_t stride = 0; 629 | HANDLE(Dart_IntegerToInt64(stride_obj, &stride)); 630 | 631 | Dart_Handle offset_obj = HANDLE(Dart_GetNativeArgument(arguments, 5)); 632 | 633 | int64_t offset = 0; 634 | HANDLE(Dart_IntegerToInt64(offset_obj, &offset)); 635 | const void *pointer = reinterpret_cast(offset); 636 | 637 | glVertexAttribPointer(index, size, type, normalized, stride, pointer); 638 | TRACE_END(glVertexAttribPointer_); 639 | } 640 | -------------------------------------------------------------------------------- /lib/src/manual_bindings.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | part of gl; 7 | 8 | /// Create an [ActiveInfo] object for the given [program] and [index] 9 | ActiveInfo glGetActiveAttrib(int program, int index) native "glGetActiveAttrib"; 10 | 11 | /// Create an [ActiveInfo] object for the given [program] and [index] 12 | ActiveInfo glGetActiveUniform(int program, int index) 13 | native "glGetActiveUniform"; 14 | 15 | /// Returns a list of shaders attached to [program] 16 | List glGetAttachedShaders(int program) native "glGetAttachedShaders"; 17 | 18 | /// Returns the [bool] result(s) of [glGetBooleanv] 19 | List glGetBooleanv(int pname) native "glGetBooleanv"; 20 | 21 | /// Returns the [int] result of [glGetBufferParameteriv] 22 | int glGetBufferParameteriv(int target, int pname) 23 | native "glGetBufferParameteriv"; 24 | 25 | /// Returns the [double] result(s) of [glGetFloatv] 26 | List glGetFloatv(int pname) native "glGetFloatv"; 27 | 28 | /// Returns the [int] result of [glGetFramebufferAttachmentParameteriv] 29 | int glGetFramebufferAttachmentParameteriv(int target, int attachment, int pname) 30 | native "glGetFramebufferAttachmentParameteriv"; 31 | 32 | /// Returns the [int] result(s) of [glGetIntegerv] 33 | List glGetIntegerv(int pname) native "glGetIntegerv"; 34 | 35 | /// Return the programiv as an [int] 36 | int glGetProgramiv(int program, int pname) native "glGetProgramiv"; 37 | 38 | /// Return a [String] containing the info log for [program] 39 | String glGetProgramInfoLog(int program) native "glGetProgramInfoLog"; 40 | 41 | /// Returns the [int] result of [glGetRenderbufferParameteriv] 42 | int glGetRenderbufferParameteriv(int target, int pname) 43 | native "glGetRenderbufferParameteriv"; 44 | 45 | /// Return the shaderiv as an [int] 46 | int glGetShaderiv(int shader, int pname) native "glGetShaderiv"; 47 | 48 | /// Return a [String] containing the info log for [shader] 49 | String glGetShaderInfoLog(int shader) native "glGetShaderInfoLog"; 50 | 51 | /// Returns a [ShaderPrecisionFormat] describing the range and precision for 52 | /// different shader numeric formats 53 | ShaderPrecisionFormat glGetShaderPrecisionFormat( 54 | int shadertype, int precisiontype) native "glGetShaderPrecisionFormat"; 55 | 56 | /// Return the GLSL source code of [shader] 57 | String glGetShaderSource(int shader) native "glGetShaderSource"; 58 | 59 | /// Returns the [double] result of [glGetTexParameterfv] 60 | double glGetTexParameterfv(int target, int pname) native "glGetTexParameterfv"; 61 | 62 | /// Returns the [int] result of [glGetTexParameteriv] 63 | int glGetTexParameteriv(int target, int pname) native "glGetTexParameteriv"; 64 | 65 | /// Returns the [double] result of [glGetUniformfv] 66 | double glGetUniformfv(int program, int location) native "glGetUniformfv"; 67 | 68 | /// Returns the [int] result of [glGetUniformiv] 69 | int glGetUniformiv(int program, int location) native "glGetUniformiv"; 70 | 71 | /// Returns the [double] result of [glGetVertexAttribfv] 72 | double glGetVertexAttribfv(int index, int pname) native "glGetVertexAttribfv"; 73 | 74 | /// Returns the [int] result of [glGetAttribiv] 75 | int glGetVertexAttribiv(int index, int pname) native "glGetVertexAttribiv"; 76 | 77 | /// Returns the address (i.e. offset in bytes of the first vertex attribute of 78 | /// the array at [index]) of the specified generic vertex attribute pointer 79 | int glGetVertexAttribPointerv(int index, int pname) 80 | native "glGetVertexAttribPointerv"; 81 | 82 | /// Reads a block of pixels from the framebuffer into the [TypedData] [pixels] parameter 83 | void glReadPixels(int x, int y, int width, int height, int format, int type, 84 | TypedData pixels) native "glReadPixels"; 85 | 86 | /// Upload a GLSL shader in [string] to the GPU for compilation 87 | void glShaderSource(int shader, String string) native "glShaderSource"; 88 | 89 | /// Set texture float parameters 90 | void glTexParameterfv(int target, int pname, List params) 91 | native "glTexParameterfv"; 92 | 93 | /// Set texture integer parameters 94 | void glTexParameteriv(int target, int pname, List params) 95 | native "glTexParameteriv"; 96 | 97 | /// Specifies the layout of data associated with a vertex attribute. 98 | /// 99 | /// Note that in the underlying C-language call, [offset] is a void pointer 100 | /// representing the offset of the attribute data within the buffer. In this 101 | /// Dart implementation, we represent the same offset as an integer number of 102 | /// bytes. 103 | void glVertexAttribPointer(int index, int size, int type, bool normalized, 104 | int stride, int offset) native "glVertexAttribPointer"; 105 | -------------------------------------------------------------------------------- /lib/src/manual_bindings.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | #ifndef DART_GL_LIB_SRC_MANUAL_BINDINGS_H_ 7 | #define DART_GL_LIB_SRC_MANUAL_BINDINGS_H_ 8 | 9 | #include "dart_api.h" 10 | 11 | void glGetActiveAttrib_native(Dart_NativeArguments arguments); 12 | void glGetActiveUniform_native(Dart_NativeArguments arguments); 13 | void glGetAttachedShaders_native(Dart_NativeArguments arguments); 14 | void glGetBooleanv_native(Dart_NativeArguments arguments); 15 | void glGetBufferParameteriv_native(Dart_NativeArguments arguments); 16 | void glGetFloatv_native(Dart_NativeArguments arguments); 17 | void glGetFramebufferAttachmentParameteriv_native( 18 | Dart_NativeArguments arguments); 19 | void glGetIntegerv_native(Dart_NativeArguments arguments); 20 | void glGetProgramiv_native(Dart_NativeArguments arguments); 21 | void glGetProgramInfoLog_native(Dart_NativeArguments arguments); 22 | void glGetRenderbufferParameteriv_native(Dart_NativeArguments arguments); 23 | void glGetShaderiv_native(Dart_NativeArguments arguments); 24 | void glGetShaderInfoLog_native(Dart_NativeArguments arguments); 25 | void glGetShaderPrecisionFormat_native(Dart_NativeArguments arguments); 26 | void glGetShaderSource_native(Dart_NativeArguments arguments); 27 | void glGetTexParameterfv_native(Dart_NativeArguments arguments); 28 | void glGetTexParameteriv_native(Dart_NativeArguments arguments); 29 | void glGetUniformfv_native(Dart_NativeArguments arguments); 30 | void glGetUniformiv_native(Dart_NativeArguments arguments); 31 | void glGetVertexAttribfv_native(Dart_NativeArguments arguments); 32 | void glGetVertexAttribiv_native(Dart_NativeArguments arguments); 33 | void glGetVertexAttribPointerv_native(Dart_NativeArguments arguments); 34 | void glReadPixels_native(Dart_NativeArguments arguments); 35 | void glShaderSource_native(Dart_NativeArguments arguments); 36 | void glTexParameterfv_native(Dart_NativeArguments arguments); 37 | void glTexParameteriv_native(Dart_NativeArguments arguments); 38 | void glVertexAttribPointer_native(Dart_NativeArguments arguments); 39 | 40 | #endif // DART_GL_LIB_SRC_MANUAL_BINDINGS_H_ 41 | -------------------------------------------------------------------------------- /lib/src/util.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | // This file contains utility functions for the GL Dart native extension. 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include "dart_api.h" 17 | 18 | #include "util.h" 19 | 20 | Dart_Handle HandleError(Dart_Handle handle) { 21 | if (Dart_IsError(handle)) { 22 | Dart_PropagateError(Dart_NewUnhandledExceptionError(handle)); 23 | } 24 | return handle; 25 | } 26 | 27 | Dart_Handle Dart_IntegerToUInt(Dart_Handle integer, unsigned int *value) { 28 | int64_t actual; 29 | HandleError(Dart_IntegerToInt64(integer, &actual)); 30 | 31 | if (actual < UINT_MAX) { 32 | *value = static_cast(actual); 33 | return Dart_True(); 34 | } else { 35 | char buf[50]; // Technically we only need 46 characters for this. 36 | snprintf(buf, sizeof(buf), "%" PRId64 " does not fit into an unsigned int.", 37 | actual); 38 | return Dart_NewApiError(buf); 39 | } 40 | } 41 | 42 | Dart_Handle Dart_NewStringFromGLubyteString(const GLubyte *string) { 43 | return Dart_NewStringFromCString(reinterpret_cast(string)); 44 | } 45 | 46 | // The length of the resulting array of values for a call to glGetBooleanv, 47 | // glGetFloatv, or glGetIntegerv with the given parameter. Note that some 48 | // parameters return a variable-length list of values. The length of the list 49 | // must be queried via another call to glGetIntegerv (these parameters are 50 | // not in the map below, but are handled specially in `GetGlGetResultLength`). 51 | const std::map kGlGetResultLengths = { 52 | {GL_ACTIVE_TEXTURE, 1}, 53 | {GL_ALIASED_LINE_WIDTH_RANGE, 2}, 54 | {GL_ALIASED_POINT_SIZE_RANGE, 2}, 55 | {GL_ALPHA_BITS, 1}, 56 | {GL_ARRAY_BUFFER_BINDING, 1}, 57 | {GL_BLEND, 1}, 58 | {GL_BLEND_COLOR, 4}, 59 | {GL_BLEND_DST_ALPHA, 1}, 60 | {GL_BLEND_SRC_ALPHA, 1}, 61 | {GL_BLEND_EQUATION_ALPHA, 1}, 62 | {GL_BLEND_EQUATION_RGB, 1}, 63 | {GL_BLEND_SRC_RGB, 1}, 64 | {GL_BLEND_DST_RGB, 1}, 65 | {GL_BLUE_BITS, 1}, 66 | {GL_COLOR_CLEAR_VALUE, 4}, 67 | {GL_COLOR_WRITEMASK, 4}, 68 | {GL_CULL_FACE, 1}, 69 | {GL_CULL_FACE_MODE, 1}, 70 | {GL_CURRENT_PROGRAM, 1}, 71 | {GL_DEPTH_BITS, 1}, 72 | {GL_DEPTH_CLEAR_VALUE, 1}, 73 | {GL_DEPTH_FUNC, 1}, 74 | {GL_DEPTH_RANGE, 2}, 75 | {GL_DEPTH_TEST, 1}, 76 | {GL_DEPTH_WRITEMASK, 1}, 77 | {GL_DITHER, 1}, 78 | {GL_ELEMENT_ARRAY_BUFFER_BINDING, 1}, 79 | {GL_FRAMEBUFFER_BINDING, 1}, 80 | {GL_FRONT_FACE, 1}, 81 | {GL_GENERATE_MIPMAP_HINT, 1}, 82 | {GL_GREEN_BITS, 1}, 83 | {GL_IMPLEMENTATION_COLOR_READ_FORMAT, 1}, 84 | {GL_IMPLEMENTATION_COLOR_READ_TYPE, 1}, 85 | {GL_LINE_WIDTH, 1}, 86 | {GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, 1}, 87 | {GL_MAX_CUBE_MAP_TEXTURE_SIZE, 1}, 88 | {GL_MAX_FRAGMENT_UNIFORM_VECTORS, 1}, 89 | {GL_MAX_RENDERBUFFER_SIZE, 1}, 90 | {GL_MAX_TEXTURE_IMAGE_UNITS, 1}, 91 | {GL_MAX_TEXTURE_SIZE, 1}, 92 | {GL_MAX_VARYING_VECTORS, 1}, 93 | {GL_MAX_VERTEX_ATTRIBS, 1}, 94 | {GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, 1}, 95 | {GL_MAX_VERTEX_UNIFORM_VECTORS, 1}, 96 | {GL_MAX_VIEWPORT_DIMS, 2}, 97 | {GL_NUM_COMPRESSED_TEXTURE_FORMATS, 1}, 98 | {GL_NUM_SHADER_BINARY_FORMATS, 1}, 99 | {GL_PACK_ALIGNMENT, 1}, 100 | {GL_POLYGON_OFFSET_FACTOR, 1}, 101 | {GL_POLYGON_OFFSET_FILL, 1}, 102 | {GL_POLYGON_OFFSET_UNITS, 1}, 103 | {GL_RED_BITS, 1}, 104 | {GL_RENDERBUFFER_BINDING, 1}, 105 | {GL_SAMPLE_ALPHA_TO_COVERAGE, 1}, 106 | {GL_SAMPLE_BUFFERS, 1}, 107 | {GL_SAMPLE_COVERAGE, 1}, 108 | {GL_SAMPLE_COVERAGE_INVERT, 1}, 109 | {GL_SAMPLE_COVERAGE_VALUE, 1}, 110 | {GL_SAMPLES, 1}, 111 | {GL_SCISSOR_BOX, 4}, 112 | {GL_SCISSOR_TEST, 1}, 113 | {GL_SHADER_COMPILER, 1}, 114 | {GL_STENCIL_CLEAR_VALUE, 1}, 115 | {GL_STENCIL_BACK_FAIL, 1}, 116 | {GL_STENCIL_BACK_FUNC, 1}, 117 | {GL_STENCIL_BACK_PASS_DEPTH_FAIL, 1}, 118 | {GL_STENCIL_BACK_PASS_DEPTH_PASS, 1}, 119 | {GL_STENCIL_BACK_REF, 1}, 120 | {GL_STENCIL_BACK_VALUE_MASK, 1}, 121 | {GL_STENCIL_BACK_WRITEMASK, 1}, 122 | {GL_STENCIL_BITS, 1}, 123 | {GL_STENCIL_FAIL, 1}, 124 | {GL_STENCIL_FUNC, 1}, 125 | {GL_STENCIL_PASS_DEPTH_FAIL, 1}, 126 | {GL_STENCIL_PASS_DEPTH_PASS, 1}, 127 | {GL_STENCIL_REF, 1}, 128 | {GL_STENCIL_TEST, 1}, 129 | {GL_STENCIL_VALUE_MASK, 1}, 130 | {GL_STENCIL_WRITEMASK, 1}, 131 | {GL_SUBPIXEL_BITS, 1}, 132 | {GL_TEXTURE_BINDING_2D, 1}, 133 | {GL_TEXTURE_BINDING_CUBE_MAP, 1}, 134 | {GL_UNPACK_ALIGNMENT, 1}, 135 | {GL_VIEWPORT, 4}, 136 | }; 137 | 138 | // Looks up the number of values returned for a call to glGet*v in the map. 139 | GLint GetGlGetResultLength(GLenum param) { 140 | // There are two parameters that return a variable number of arguments, 141 | // so the length must be queried via another call to glGetIntegerv. In 142 | // all other cases, we'll just look up the value in the map. 143 | GLint length = -1; 144 | switch (param) { 145 | case GL_COMPRESSED_TEXTURE_FORMATS: 146 | glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &length); 147 | return length; 148 | 149 | case GL_SHADER_BINARY_FORMATS: 150 | glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &length); 151 | return length; 152 | 153 | default: 154 | std::map::const_iterator itr = 155 | kGlGetResultLengths.find(param); 156 | if (itr != kGlGetResultLengths.end()) { 157 | length = itr->second; 158 | } 159 | return length; 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /lib/src/util.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 2 | // Please see the AUTHORS file for details. Use of this source code is governed 3 | // by a BSD-style license that can be found in the LICENSE file or at 4 | // https://developers.google.com/open-source/licenses/bsd 5 | 6 | #ifndef DART_GL_LIB_SRC_UTIL_H_ 7 | #define DART_GL_LIB_SRC_UTIL_H_ 8 | 9 | #include 10 | #include "dart_api.h" 11 | 12 | Dart_Handle HandleError(Dart_Handle handle); 13 | Dart_Handle Dart_IntegerToUInt(Dart_Handle integer, unsigned int* value); 14 | Dart_Handle Dart_NewStringFromGLubyteString(const GLubyte* string); 15 | 16 | // Fetches the length of the array of return values for a call to 17 | // glGetBooleanv, glGetFloatv, or glGetIntegerv. 18 | GLint GetGlGetResultLength(GLenum param); 19 | 20 | #if defined(GL_TRACING) 21 | #include "dart_tools_api.h" 22 | #define TRACE_START(name) \ 23 | Dart_TimelineEvent(#name, Dart_TimelineGetMicros(), 0, \ 24 | Dart_Timeline_Event_Begin, 0, NULL, NULL) 25 | #define TRACE_END(name) \ 26 | Dart_TimelineEvent(#name, Dart_TimelineGetMicros(), 0, \ 27 | Dart_Timeline_Event_End, 0, NULL, NULL) 28 | #else 29 | #define TRACE_START(name) \ 30 | do { \ 31 | } while (0) 32 | #define TRACE_END(name) \ 33 | do { \ 34 | } while (0) 35 | #endif 36 | 37 | #if defined(GL_TESTING) 38 | #define HANDLE(handle) HandleError(handle) 39 | #else 40 | #define HANDLE(handle) handle 41 | #endif 42 | 43 | #endif // DART_GL_LIB_SRC_UTIL_H_ 44 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: gl 2 | version: "1.0.3+1" 3 | description: Dart GLES2 bindings 4 | authors: 5 | - John McDole 6 | - Jason Daly 7 | - Michael McLennan 8 | - Harry Stern 9 | homepage: 10 | environment: 11 | sdk: ">=2.0.0-dev.36.0 <3.0.0" 12 | dev_dependencies: 13 | args: ^1.4.3 14 | #glfw: ^1.0.2 # for examples in example/dart_example/ - needs to symlink locally 15 | glfw: 16 | path: ../dart-glfw 17 | path: ^1.6.0 18 | -------------------------------------------------------------------------------- /tools/gl_generator.dart: -------------------------------------------------------------------------------- 1 | /// Consumes "gl2.h" header file and generates bindings for libgl_extension.so 2 | import 'dart:convert'; 3 | import 'dart:io'; 4 | 5 | import 'package:args/args.dart'; 6 | import 'package:path/path.dart' as path; 7 | 8 | String outPath; 9 | 10 | /// Specific APIs that need manual bindings, but we're too lazy to write them. 11 | var manualBindingList = new Set.from([ 12 | // Commands is not a string - it is typed data of length numCommands 13 | 'glPathCommandsNV', 14 | ]); 15 | 16 | bool debugDll; 17 | 18 | main(List args) async { 19 | var parser = new ArgParser() 20 | ..addOption('gl_path', 21 | help: 'path to directory containing gl2.h', 22 | abbr: 'g', 23 | valueHelp: 'path') 24 | ..addOption('out', 25 | help: 'path to output directory', abbr: 'o', valueHelp: 'path') 26 | ..addOption('limit-api', 27 | help: 'list of functions that are bound', 28 | abbr: 'l', 29 | valueHelp: 'limit.txt') 30 | ..addFlag('debug-dll', 31 | negatable: true, 32 | defaultsTo: false, 33 | hide: true, 34 | help: 'print the results of looking up symbols') 35 | ..addFlag('help', abbr: 'h', negatable: false); 36 | var results = parser.parse(args); 37 | 38 | if (results.wasParsed('help')) { 39 | stdout.writeln(parser.usage); 40 | exit(0); 41 | } 42 | 43 | debugDll = results['debug-dll']; 44 | 45 | toErr(String msg, [int exitVal = 1]) { 46 | stderr..writeln(msg)..writeln(parser.usage); 47 | exit(exitVal); 48 | } 49 | 50 | if (!results.wasParsed('gl_path')) { 51 | toErr('error: --gl_path must be provided'); 52 | } 53 | var glPath = results['gl_path']; 54 | 55 | outPath = '.'; 56 | if (results.wasParsed('out')) { 57 | outPath = results['out']; 58 | } 59 | var generated = await new Directory('$outPath/generated').create(); 60 | outPath = generated.path; 61 | 62 | var calls = []; 63 | var consts = {}; 64 | var extCalls = []; 65 | for (var file in ['gl2.h', 'gl2ext.h']) { 66 | var readStream = new File(path.join(glPath, file)).openRead(); 67 | await for (var line in readStream 68 | .cast>() 69 | .transform(utf8.decoder) 70 | .transform(new LineSplitter())) { 71 | if (line.startsWith('#define GL_')) { 72 | var match = CConst.defineReg.firstMatch(line); 73 | if (match == null) { 74 | print("bad define: $line"); 75 | continue; 76 | } 77 | consts.putIfAbsent(match[1], () => new CConst(match[1], match[2])); 78 | } else if (line.startsWith('GL_APICALL ')) { 79 | ((file == 'gl2.h') ? calls : extCalls).add(line 80 | .replaceAll('GL_APICALL ', '') 81 | .replaceAll('GL_APIENTRY ', '') 82 | .trim()); 83 | } 84 | } 85 | } 86 | 87 | var decls = []..addAll(calls.map((c) => new CDecl(c))); 88 | var loadDecls = [] 89 | ..addAll(extCalls.map((c) => new CDecl(c, dlsym: true))); 90 | var all = []..addAll(decls)..addAll(loadDecls); 91 | 92 | writeFunctionListH(all); 93 | writeFunctionListC(all); 94 | writeGlBindingsH(all); 95 | writeGlBindingsC(all); 96 | writeGlConstantsDart(consts.values); 97 | writeGlNativeFunctions(all); 98 | } 99 | 100 | const String copyright = ''' 101 | // Copyright (c) 2015, the Dart GL extension authors. All rights reserved. 102 | // Please see the AUTHORS file for details. Use of this source code is governed 103 | // by a BSD-style license that can be found in the LICENSE file or at 104 | // https://developers.google.com/open-source/licenses/bsd 105 | 106 | // This file is auto-generated by scripts in the tools/ directory. 107 | '''; 108 | 109 | /// Maps C types to Dart types. 110 | const typeMap = const { 111 | "const GLubyte*": "String", 112 | "const GLvoid*": "TypedData", 113 | "const void*": "TypedData", 114 | "GLenum": "int", 115 | "GLint": "int", 116 | "GLfloat": "double", 117 | "GLclampf": "double", 118 | "const GLchar*": "String", 119 | "GLboolean": "int", 120 | "GLuint": "int", 121 | "GLsizei": "int", 122 | "GLsizeiptr": "int", 123 | "GLintptr": "int", 124 | "GLbitfield": "int", 125 | "int": "int", 126 | "bool": "int", 127 | "void": "void", 128 | "const char*": "String", 129 | "double": "double", 130 | "float": "double", 131 | }; 132 | 133 | /// If the return type is "GLboolean", return bool back to dart code as 134 | /// conditional statements expect boolean evaluation in Dart. 135 | const returnTypeOverride = const { 136 | "GLboolean": "bool", 137 | }; 138 | 139 | /// Maps special GL API arguments to Dart types. 140 | /// 141 | /// NOTE: This is **very** brittle. 142 | const argumentTypeHint = const { 143 | // for glUniform*iv 144 | "const GLint* value": "TypedData", 145 | "const GLint* v": "TypedData", 146 | "const GLuint* arrays": "TypedData", 147 | // for glUniform*fv 148 | "const GLfloat* value": "TypedData", 149 | // for glVertexAttrib*fv 150 | "const GLfloat* v": "TypedData", 151 | "const GLfloat* values": "TypedData", 152 | }; 153 | 154 | writeFunctionListH(List decls) { 155 | var typedefs = new StringBuffer(); 156 | var dls = new StringBuffer(); 157 | for (var decl in decls 158 | .where((d) => d.dlsym && !d.hasManualBinding && !d.needsManualBinding)) { 159 | var upper = 'PF${decl.name.toUpperCase()}'; 160 | typedefs 161 | ..write('typedef ') 162 | ..write(decl.returnType) 163 | ..write(' (APIENTRY* ') 164 | ..write(upper) 165 | ..write(')(') 166 | ..write(decl.arguments.map((a) => a.left).join(',')) 167 | ..writeln(');'); 168 | dls.writeln(' $upper ${decl.name};'); 169 | } 170 | 171 | new File('$outPath/function_list.h').writeAsString(''' 172 | $copyright 173 | #ifndef DART_GL_LIB_SRC_GENERATED_FUNCTION_LIST_H_ 174 | #define DART_GL_LIB_SRC_GENERATED_FUNCTION_LIST_H_ 175 | 176 | #include "dart_api.h" 177 | #include 178 | 179 | #if defined(WIN32) 180 | #include 181 | #if !defined(APIENTRY) 182 | #define APIENTRY __stdcall 183 | #endif 184 | #define _dlopen(name) LoadLibraryA(name) 185 | #define _dlclose(handle) FreeLibrary((HMODULE)handle) 186 | #define _dlsym(handle, name) GetProcAddress((HMODULE)handle, name) 187 | #else 188 | #include 189 | #define APIENTRY 190 | #define _dlopen(name) dlopen(name, RTLD_LAZY | RTLD_LOCAL) 191 | #define _dlclose(handle) dlclose(handle) 192 | #define _dlsym(handle, name) dlsym(handle, name) 193 | #endif 194 | 195 | struct FunctionLookup { 196 | const char* name; 197 | Dart_NativeFunction function; 198 | }; 199 | 200 | extern const struct FunctionLookup *function_list; 201 | 202 | // Attempt to load functions from gl2ext 203 | void loadFunctions(); 204 | 205 | // Dynamically loaded functions. 206 | $typedefs 207 | 208 | struct DynamicFunctions { 209 | void* handle; 210 | $dls 211 | }; 212 | 213 | extern struct DynamicFunctions dll; 214 | 215 | #endif // DART_GL_LIB_SRC_GENERATED_FUNCTION_LIST_H_ 216 | '''); 217 | } 218 | 219 | writeGlConstantsDart(Iterable consts) { 220 | new File('$outPath/gl_constants.dart').openWrite() 221 | ..write(copyright) 222 | ..writeln('\n// Generated GL constants.') 223 | ..writeAll(consts, '\n') 224 | ..close(); 225 | } 226 | 227 | writeGlNativeFunctions(List decls) { 228 | var sink = new File('$outPath/gl_native_functions.dart').openWrite() 229 | ..write(copyright) 230 | ..writeln() 231 | ..writeln('/// Dart definitions for GL native extension.') 232 | ..writeln('part of gl;') 233 | ..writeln(); 234 | for (var decl in decls) { 235 | if (decl.hasManualBinding || decl.needsManualBinding) continue; 236 | sink.write('${decl.dartReturnType} ${decl.name}'); 237 | if (decl.dartArguments.isEmpty || decl.arguments.first.right == "void") { 238 | sink.write('()'); 239 | } else { 240 | sink.write('(${decl.dartArguments.join(', ')})'); 241 | } 242 | sink.writeln(' native "${decl.name}";'); 243 | } 244 | sink.close(); 245 | } 246 | 247 | writeFunctionListC(List decls) { 248 | functionListLine(CDecl c) => ' ' 249 | '${c.needsManualBinding && !c.hasManualBinding ? "// " : ""}' 250 | '{"${c.name}", ${c.nativeName}},'; 251 | 252 | var write = new File('$outPath/function_list.cc').openWrite() 253 | ..write(copyright) 254 | ..write(''' 255 | #include 256 | #include 257 | 258 | #include "../manual_bindings.h" 259 | #include "function_list.h" 260 | #include "gl_bindings.h" 261 | 262 | // function_list is used by ResolveName in lib/src/gl_extension.cc. 263 | const struct FunctionLookup _function_list[] = { 264 | ''') 265 | ..write(decls.map(functionListLine).join('\n')) 266 | ..writeln() 267 | ..writeln(''' 268 | {NULL, NULL}}; 269 | // This prevents the compiler from complaining about initializing improperly. 270 | const struct FunctionLookup *function_list = _function_list; 271 | '''); 272 | 273 | write..write(''' 274 | struct DynamicFunctions dll; 275 | void loadFunctions() { 276 | int i; 277 | const char* sonames[] { 278 | #if defined(WIN32) 279 | "libGLESv2.dll", 280 | "GLESv2.dll", 281 | #else 282 | "libGLESv2.so", 283 | "GLESv2.so", 284 | #endif 285 | NULL 286 | }; 287 | 288 | if (dll.handle) return; 289 | for (i = 0; sonames[i]; i++) { 290 | dll.handle = _dlopen(sonames[i]); 291 | if (dll.handle) break; 292 | } 293 | 294 | if (!dll.handle) { 295 | fprintf(stderr, "FATAL: unable to load gles2 library\\n"); 296 | return; 297 | } 298 | '''); 299 | 300 | for (var decl in decls 301 | .where((d) => d.dlsym && !d.hasManualBinding && !d.needsManualBinding)) { 302 | var upper = 'PF${decl.name.toUpperCase()}'; 303 | write.writeln(' dll.${decl.name} = ($upper) ' 304 | '_dlsym(dll.handle, "${decl.name}");'); 305 | if (decl.name.endsWith("OES")) { 306 | // Some drivers have already promoted these to GLESv3 307 | write.writeln(''' 308 | if (!dll.${decl.name}) { 309 | dll.${decl.name} = ($upper) _dlsym(dll.handle, "${decl.name.substring(0, decl.name.length - 3)}"); 310 | }'''); 311 | } 312 | if (debugDll) { 313 | write.writeln(''' 314 | if (dll.${decl.name}) { 315 | printf(" dlsym(%p, \\"${decl.name}\\") => %p\\n", 316 | dll.handle, (void*)dll.${decl.name}); 317 | }'''); 318 | } 319 | } 320 | write.writeln('}'); 321 | write.close(); 322 | } 323 | 324 | writeGlBindingsH(List decls) { 325 | var sink = new File('$outPath/gl_bindings.h').openWrite() 326 | ..write(copyright) 327 | ..write(''' 328 | #ifndef DART_GL_LIB_SRC_GENERATED_GENERATED_BINDINGS_H_ 329 | #define DART_GL_LIB_SRC_GENERATED_GENERATED_BINDINGS_H_ 330 | 331 | #include "dart_api.h" 332 | '''); 333 | sink 334 | ..writeln() 335 | ..writeln('// Header file for generated GL function bindings.') 336 | ..writeln() 337 | ..writeln(decls 338 | .where((d) => !d.hasManualBinding && !d.needsManualBinding) 339 | .map((d) => 'void ${d.nativeName}(Dart_NativeArguments arguments);') 340 | .join('\n')) 341 | ..writeln() 342 | ..write('#endif // DART_GL_LIB_SRC_GENERATED_GENERATED_BINDINGS_H_') 343 | ..writeln() 344 | ..close(); 345 | } 346 | 347 | writeGlBindingsC(List decls) { 348 | var sink = new File('$outPath/gl_bindings.cc').openWrite(); 349 | sink..write(copyright)..write(''' 350 | #include 351 | #include 352 | #include 353 | 354 | #include 355 | #include 356 | 357 | #include "../util.h" 358 | #include "gl_bindings.h" 359 | #include "function_list.h" 360 | 361 | // Generated GL function bindings for Dart. 362 | 363 | '''); 364 | 365 | // Create a binding function for each declaration in the GL header file. 366 | for (var decl in decls) { 367 | // If the function has a manual binding, or we've detected that it needs 368 | // one, skip it. 369 | if (decl.needsManualBinding || decl.hasManualBinding) continue; 370 | 371 | // Write the first line (return type, name, and arguments). 372 | sink..writeln('void ${decl.nativeName}(Dart_NativeArguments arguments) {'); 373 | if (decl.dlsym) { 374 | sink..writeln(''' 375 | if (!dll.${decl.name}) { 376 | return; 377 | }'''); 378 | } 379 | 380 | sink..writeln('TRACE_START(${decl.name}_);'); 381 | 382 | // For each argument, generate the code needed to extract it from the 383 | // Dart_NativeArguments structure. 384 | int i = 0; 385 | var typed = []; 386 | var arguments = []; 387 | if (decl.isGenerator) { 388 | var arg = decl.arguments[0]; 389 | var dartArg = decl.dartArguments[0]; 390 | sink.writeln(dartTypeToArg[dartArg.left](arg, i)); 391 | arguments.add(arg.right); 392 | if (dartArg.left == 'TypedData') { 393 | typed.add(arg); 394 | } 395 | } else if (decl.isDeleter) { 396 | sink.writeln('Dart_Handle values_obj = ' 397 | 'HANDLE(Dart_GetNativeArgument(arguments, 0));'); 398 | } else { 399 | for (var arg in decl.arguments) { 400 | if (arg.right == "void") continue; 401 | var dartArg = decl.dartArguments[i]; 402 | 403 | if (dartTypeToArg[dartArg.left] == null) { 404 | throw "dartTypeToArg($dartArg) is null; $decl"; 405 | } 406 | sink.writeln(dartTypeToArg[dartArg.left](arg, i)); 407 | arguments.add(arg.right); 408 | if (dartArg.left == 'TypedData') { 409 | typed.add(arg); 410 | } 411 | i++; 412 | } 413 | } 414 | // Be sure to capture the return value from the GL function call, if 415 | // necessary. 416 | var ret = ""; 417 | var retHandle = ""; 418 | if (decl.returnType != "void") { 419 | ret = '${decl.returnType} ret = '; 420 | retHandle = dartTypeToRet[decl.dartReturnType](); 421 | } 422 | 423 | if (decl.isGenerator) { 424 | String count = decl.arguments[0].right; 425 | sink..writeln(''' 426 | GLuint *values = static_cast(malloc(sizeof(GLuint) * $count)); 427 | ${decl.dlsym ? 'dll.' : ''}${decl.name}($count, values); 428 | Dart_Handle values_obj = Dart_NewListOf(Dart_CoreType_Int, $count); 429 | for (int i = 0; i < $count; i++) { 430 | Dart_Handle i_obj = HANDLE(Dart_NewInteger(values[i])); 431 | HANDLE(Dart_ListSetAt(values_obj, i, i_obj)); 432 | } 433 | Dart_SetReturnValue(arguments, values_obj); 434 | free(values); 435 | '''); 436 | } else if (decl.isDeleter) { 437 | sink.writeln(''' 438 | GLuint *values = NULL; 439 | intptr_t n = 0; 440 | HANDLE(Dart_ListLength(values_obj, &n)); 441 | values = static_cast(malloc(sizeof(GLuint) * n)); 442 | for (int i = 0; i < n; i++) { 443 | Dart_Handle i_obj = HANDLE(Dart_ListGetAt(values_obj, i)); 444 | HANDLE(Dart_IntegerToUInt(i_obj, &values[i])); 445 | } 446 | ${decl.dlsym ? 'dll.' : ''}${decl.name}(n, values); 447 | free(values); 448 | '''); 449 | } else { 450 | // Generate the actual GL function call, using the native arguments 451 | // extracted above. 452 | 453 | ret = 454 | '$ret ${decl.dlsym ? 'dll.' : ''}${decl.name}(${arguments.join(", ")});'; 455 | sink..writeln(ret)..writeln(retHandle); 456 | } 457 | 458 | // If we acquired any TypedData while processing arguments above, release 459 | // it now. 460 | for (var arg in typed) { 461 | sink.writeln(typedRelease(arg)); 462 | } 463 | 464 | sink..writeln('TRACE_END(${decl.name}_);')..writeln('}')..writeln(); 465 | } 466 | sink.close(); 467 | } 468 | 469 | typedef DartTypeToC(Pair arg, int index); 470 | typedef DartTypeToRet(); 471 | 472 | /// Map of Dart argument types to unpacking functions. 473 | final dartTypeToArg = { 474 | 'int': intToC, 475 | 'double': doubleToC, 476 | 'String': stringToC, 477 | 'bool': boolToC, 478 | 'TypedData': typedToC 479 | }; 480 | 481 | /// Map of Dart return types to packing functions. 482 | final dartTypeToRet = { 483 | 'int': intToRet, 484 | 'double': doubleToRet, 485 | 'String': stringToRet, 486 | 'bool': boolToRet, 487 | }; 488 | 489 | /// Unpacks Dart int arguments to C. 490 | intToC(Pair arg, int index) { 491 | String name = arg.right; 492 | return ''' 493 | int64_t $name; 494 | HANDLE(Dart_GetNativeIntegerArgument(arguments, $index, &$name)); 495 | '''; 496 | } 497 | 498 | /// Unpacks Dart double arguments to C. 499 | doubleToC(Pair arg, int index) { 500 | String name = arg.right; 501 | return ''' 502 | double $name; 503 | HANDLE(Dart_GetNativeDoubleArgument(arguments, $index, &$name)); 504 | '''; 505 | } 506 | 507 | /// Unpacks Dart bool arguments to C. 508 | boolToC(Pair arg, int index) { 509 | String name = arg.right; 510 | return ''' 511 | bool $name; 512 | HANDLE(Dart_GetNativeBooleanArgument(arguments, $index, &$name)); 513 | '''; 514 | } 515 | 516 | /// Unpacks Dart String arguments to C. 517 | stringToC(Pair arg, int index) { 518 | String name = arg.right; 519 | bool unsigned = arg.left.contains("GLubyte"); 520 | return ''' 521 | void* ${name}_peer = NULL; 522 | Dart_Handle ${name}_arg = HANDLE(Dart_GetNativeStringArgument(arguments, $index, (void**)&${name}_peer)); 523 | const ${unsigned ? 'unsigned ' : ''}char *${name}; 524 | HANDLE(Dart_StringToCString(${name}_arg, ${unsigned ? '(const char**)' : 525 | ''}&${name})); 526 | '''; 527 | } 528 | 529 | /// Unpacks Dart TypedData arguments to C. 530 | /// 531 | /// NOTE: Must be freed by calling [typedRelease]. 532 | typedToC(Pair arg, int index) { 533 | String name = arg.right; 534 | String type = arg.left; 535 | return ''' 536 | Dart_Handle ${name}_obj = HANDLE(Dart_GetNativeArgument(arguments, $index)); 537 | void* ${name}_data = nullptr; 538 | Dart_TypedData_Type ${name}_typeddata_type; 539 | intptr_t ${name}_typeddata_length; 540 | if (!Dart_IsNull(${name}_obj)) { 541 | HANDLE(Dart_TypedDataAcquireData(${name}_obj, &${name}_typeddata_type, &${name}_data, &${name}_typeddata_length)); 542 | } 543 | $type $name = static_cast<$type>(${name}_data); 544 | '''; 545 | } 546 | 547 | /// Converts GL int to Dart int for return. 548 | intToRet() => 'Dart_SetIntegerReturnValue(arguments, ret);'; 549 | 550 | /// Converts GL float to Dart double for return. 551 | doubleToRet() => 'Dart_SetDoubleReturnValue(arguments, ret);'; 552 | 553 | /// Converts GL boolean to Dart bool for return. 554 | boolToRet() => 'Dart_SetBooleanReturnValue(arguments, ret);'; 555 | 556 | /// Converts GL strings to Dart String for return. 557 | stringToRet() { 558 | return 'Dart_SetReturnValue(arguments, ' 559 | 'HANDLE(Dart_NewStringFromCString(reinterpret_cast(ret))));'; 560 | } 561 | 562 | /// Releases unpacked TypedData arguments. 563 | typedRelease(Pair arg) { 564 | String name = arg.right; 565 | String type = arg.left; 566 | return ''' 567 | if (!Dart_IsNull(${name}_obj)) { 568 | HANDLE(Dart_TypedDataReleaseData(${name}_obj)); 569 | } 570 | '''; 571 | } 572 | 573 | /// A simple left/right String tuple. 574 | class Pair { 575 | String left; 576 | String right; 577 | 578 | Pair(this.left, this.right); 579 | 580 | Pair.fromList(List pairs) : this(pairs[0], pairs[1]); 581 | 582 | String toString() => '$left $right'.trim(); 583 | } 584 | 585 | /// C declaration parser which parses an API function declaration from gl2.h 586 | /// into its constituent parts. 587 | class CDecl { 588 | static final ws = new RegExp(r'\s+'); 589 | static final comma = new RegExp(r'\s*,\s+'); 590 | 591 | String name; 592 | String returnType; 593 | List arguments = []; 594 | String dartReturnType; 595 | List dartArguments = []; 596 | 597 | /// Was this function not easily parsed? 598 | bool needsManualBinding = false; 599 | 600 | /// Does this function already have a manual binding? 601 | bool get hasManualBinding => manualBindings.contains(name); 602 | 603 | /// Removes trailing characters from a String. 604 | static String removeTrailing(String str, int num) => 605 | str.substring(0, str.length - num); 606 | 607 | /// Normalizes pointers to sit with the [type]. 608 | /// 609 | /// Examples: 610 | /// (int, *hello) -> (int*, hello) 611 | /// (const int, **const*hello) -> (const int**const, hello) 612 | /// 613 | /// cdecl.org says the second one means 614 | /// "declare hello as const pointer to pointer to const int" 615 | static List normalizePointer(String type, String name) { 616 | if (name.startsWith('*')) { 617 | return normalizePointer('${type}*', name.substring(1)); 618 | } else if (name.startsWith('&')) { 619 | return normalizePointer('${type}&', name.substring(1)); 620 | } else if (name.startsWith('const*')) { 621 | return normalizePointer('${type} const*', name.substring(6)); 622 | } else if (name.contains(array)) { 623 | print("name($name) contains []"); 624 | return normalizePointer('${type} const*', name.replaceAll(array, '')); 625 | } 626 | return [type, name]; 627 | } 628 | 629 | static final RegExp generatorFunction = new RegExp(r'glGen[A-Z]'); 630 | static final RegExp deleterFunction = new RegExp(r'glDelete[A-Z]'); 631 | static final RegExp array = new RegExp(r'\[[0-9\s]+\]$'); 632 | 633 | final bool dlsym; 634 | CDecl(String string, {this.dlsym: false}) { 635 | var left = (string.split('(')[0].trim().split(ws)..removeLast()).join(" "); 636 | var right = string.split('(')[0].trim().split(ws).last; 637 | var norms = normalizePointer(left, right); 638 | name = norms[1]; 639 | returnType = norms[0]; 640 | 641 | if (manualBindingList.contains(name)) { 642 | needsManualBinding = true; 643 | print("$name NEEDS MANUAL BINDING: check the manualBindingList"); 644 | } 645 | 646 | int noName = 0; 647 | for (var arg 648 | in removeTrailing(string.split('(')[1], 2).trim().split(comma)) { 649 | right = arg.split(ws).last; 650 | left = (arg.split(ws)..removeLast()).join(" "); 651 | if (left == '' && right != "void") { 652 | // API without explicitly named variable 653 | left = right; 654 | right = 'noName${noName++}'; 655 | } 656 | arguments.add(new Pair.fromList(normalizePointer(left, right))); 657 | } 658 | if (hasManualBinding) return; 659 | dartReturnType = returnTypeOverride[returnType]; 660 | dartReturnType ??= typeMap[returnType]; 661 | if (dartReturnType == null) { 662 | needsManualBinding = true; 663 | print("$name RETURN TYPE NEEDS MANUAL BINDING: $returnType"); 664 | } 665 | var reason = ''; 666 | dartArguments = arguments.map((pair) { 667 | if (pair.right == "void") return new Pair("", "void"); 668 | var type = argumentTypeHint['$pair']; 669 | if (type != null) { 670 | return new Pair(type, pair.right); 671 | } 672 | type = typeMap[pair.left]; 673 | if (type == null) { 674 | reason = '${reason} Unknown type: ${pair.left}'; 675 | needsManualBinding = true; 676 | return new Pair(null, pair.right); 677 | } 678 | return new Pair(type, pair.right); 679 | }).toList(); 680 | 681 | if (isGenerator) { 682 | dartReturnType = 'List'; 683 | dartArguments = [new Pair('int', arguments[0].right)]; 684 | needsManualBinding = false; 685 | } else if (isDeleter) { 686 | dartReturnType = 'void'; 687 | dartArguments = [new Pair('List', 'values')]; 688 | needsManualBinding = false; 689 | } 690 | if (needsManualBinding) { 691 | print("$name NEEDS MANUAL BINDINGS: $string$reason, " 692 | "Discovered: $arguments $dartArguments"); 693 | } 694 | } 695 | 696 | bool get isGenerator => 697 | name.startsWith(generatorFunction) && 698 | arguments.length == 2 && 699 | typeMap[arguments.first.left] == 'int'; 700 | 701 | bool get isDeleter => 702 | name.startsWith(deleterFunction) && 703 | arguments.length == 2 && 704 | typeMap[arguments.first.left] == 'int' && 705 | arguments[1].left.contains('*'); 706 | 707 | String get nativeName => '${name}_native'; 708 | 709 | String toString() => '$returnType $name(${arguments.join(', ')}); ' 710 | '// $dartArguments -> $dartReturnType${dlsym ? ' dll' : ''}'; 711 | 712 | /// These functions have manual bindings defined in lib/src/manual_bindings.cc 713 | static final Set manualBindings = new Set.from([ 714 | "glGetActiveAttrib", 715 | "glGetActiveUniform", 716 | "glGetAttachedShaders", 717 | "glGetBooleanv", 718 | "glGetBufferParameteriv", 719 | "glGetFloatv", 720 | "glGetFramebufferAttachmentParameteriv", 721 | "glGetIntegerv", 722 | "glGetProgramiv", 723 | "glGetProgramInfoLog", 724 | "glGetRenderbufferParameteriv", 725 | "glGetShaderiv", 726 | "glGetShaderInfoLog", 727 | "glGetShaderPrecisionFormat", 728 | "glGetShaderSource", 729 | "glGetTexParameterfv", 730 | "glGetTexParameteriv", 731 | "glGetUniformfv", 732 | "glGetUniformiv", 733 | "glGetVertexAttribfv", 734 | "glGetVertexAttribiv", 735 | "glGetVertexAttribPointerv", 736 | "glReadPixels", 737 | //"glShaderBinary", 738 | "glShaderSource", 739 | "glTexParameterfv", 740 | "glTexParameteriv", 741 | "glVertexAttribPointer", 742 | ]); 743 | } 744 | 745 | /// Parses a C const from gl2.h. 746 | class CConst { 747 | static final ws = new RegExp(r'\s+'); 748 | 749 | static final defineReg = 750 | new RegExp(r'#define (GL_[_A-Za-z0-9]+)\s*(0x[0-9a-fA-F]+|[0-9]+)'); 751 | 752 | String name; 753 | String value; 754 | 755 | CConst(this.name, this.value); 756 | 757 | String toString() => 'const int $name = $value;'; 758 | } 759 | --------------------------------------------------------------------------------