Update dart:gl generator to support gl2ext
As some embedded libraries do not implement stubs, use --whitelist with
gl_generator. Better way to handle missing API is use dlopen, but in a cross
platform way.
* Auto-generate glGen[A-Z]() methods instead of making them manual
bindings.
* Auto-generate glDelete[A-Z]() methods.
* Ignore duplicate #defines
* Support non-named parameters (valid C headers).
diff --git a/README.md b/README.md
index f20a09f..4fab58a 100644
--- a/README.md
+++ b/README.md
@@ -23,12 +23,15 @@
`LD_LIBRARY_PATH` to include the same directory when running your program or
the Dart VM will not be able to find `libGL.so`/`lib$(GL_LIB_NAME).so`.
-TODO(hstern): It is convenient for development to use the .so file,
-but for distribution purposes it is less useful. It would be nice to have an
-option to use the .a library as well.
+## Whitelisting
+Some GL libraries come with headers that list functions not implemented. This
+will fail at link time. To avoid this, you can dump the symbols in
+libGLESv2.so to be whitelisted and use the `--whitelist flag in
+`tools/gl_generator.dart`
-## Windows
-Tested to work with NVIDIA, just requires building glfw with EGL support.
+```shell
+nm -D /lib/libGLESv2.so | grep " T " | awk '{print $3}' > whitelist.txt
+```
## Other Platforms
TODO
diff --git a/example/.gitignore b/example/.gitignore
deleted file mode 100644
index e69de29..0000000
--- a/example/.gitignore
+++ /dev/null
diff --git a/example/dart_example/limits.dart b/example/dart_example/limits.dart
index ee31144..62c5cd8 100644
--- a/example/dart_example/limits.dart
+++ b/example/dart_example/limits.dart
@@ -57,6 +57,11 @@
throw new ArgumentError("ERROR! Got data for an invalid GLenum!");
}
+ var extensions = glGetString(GL_EXTENSIONS).split(' ');
+ print("Extensions:");
+ for (var extension in extensions) {
+ print(" $extension");
+ }
glfwSetWindowShouldClose(window, GL_TRUE);
glfwTerminate();
}
diff --git a/lib/.gitignore b/lib/.gitignore
deleted file mode 100644
index e69de29..0000000
--- a/lib/.gitignore
+++ /dev/null
diff --git a/lib/src/.gitignore b/lib/src/.gitignore
deleted file mode 100644
index e69de29..0000000
--- a/lib/src/.gitignore
+++ /dev/null
diff --git a/lib/src/generated/function_list.cc b/lib/src/generated/function_list.cc
index b39cce5..de9a7ac 100644
--- a/lib/src/generated/function_list.cc
+++ b/lib/src/generated/function_list.cc
@@ -6,7 +6,7 @@
// This file is auto-generated by scripts in the tools/ directory.
#include <stdlib.h>
-#include "manual_bindings.h"
+#include "../manual_bindings.h"
#include "function_list.h"
#include "gl_bindings.h"
@@ -74,7 +74,8 @@
{"glGetBufferParameteriv", glGetBufferParameteriv_native},
{"glGetError", glGetError_native},
{"glGetFloatv", glGetFloatv_native},
- {"glGetFramebufferAttachmentParameteriv", glGetFramebufferAttachmentParameteriv_native},
+ {"glGetFramebufferAttachmentParameteriv",
+ glGetFramebufferAttachmentParameteriv_native},
{"glGetIntegerv", glGetIntegerv_native},
{"glGetProgramiv", glGetProgramiv_native},
{"glGetProgramInfoLog", glGetProgramInfoLog_native},
@@ -154,6 +155,33 @@
{"glVertexAttrib4fv", glVertexAttrib4fv_native},
{"glVertexAttribPointer", glVertexAttribPointer_native},
{"glViewport", glViewport_native},
+ // {"glEGLImageTargetTexture2DOES", glEGLImageTargetTexture2DOES_native},
+ // {"glEGLImageTargetRenderbufferStorageOES",
+ // glEGLImageTargetRenderbufferStorageOES_native},
+ // {"glGetProgramBinaryOES", glGetProgramBinaryOES_native},
+ {"glProgramBinaryOES", glProgramBinaryOES_native},
+ // {"glMapBufferOES", glMapBufferOES_native},
+ {"glUnmapBufferOES", glUnmapBufferOES_native},
+ // {"glGetBufferPointervOES", glGetBufferPointervOES_native},
+ {"glBindVertexArrayOES", glBindVertexArrayOES_native},
+ {"glDeleteVertexArraysOES", glDeleteVertexArraysOES_native},
+ {"glGenVertexArraysOES", glGenVertexArraysOES_native},
+ {"glIsVertexArrayOES", glIsVertexArrayOES_native},
+ // {"glDiscardFramebufferEXT", glDiscardFramebufferEXT_native},
+ // {"glMultiDrawArraysEXT", glMultiDrawArraysEXT_native},
+ // {"glMultiDrawElementsEXT", glMultiDrawElementsEXT_native},
+ {"glRenderbufferStorageMultisampleEXT",
+ glRenderbufferStorageMultisampleEXT_native},
+ {"glFramebufferTexture2DMultisampleEXT",
+ glFramebufferTexture2DMultisampleEXT_native},
+ {"glGetGraphicsResetStatusEXT", glGetGraphicsResetStatusEXT_native},
+ // {"glReadnPixelsEXT", glReadnPixelsEXT_native},
+ // {"glGetnUniformfvEXT", glGetnUniformfvEXT_native},
+ // {"glGetnUniformivEXT", glGetnUniformivEXT_native},
+ // {"glTexDirectVIVMap", glTexDirectVIVMap_native},
+ // {"glTexDirectVIV", glTexDirectVIV_native},
+ {"glTexDirectInvalidateVIV", glTexDirectInvalidateVIV_native},
+ // {"glTexDirectTiledMapVIV", glTexDirectTiledMapVIV_native},
{NULL, NULL}};
// This prevents the compiler from complaining about initializing improperly.
const struct FunctionLookup *function_list = _function_list;
diff --git a/lib/src/generated/function_list.h b/lib/src/generated/function_list.h
index 2eefa91..7ac553d 100644
--- a/lib/src/generated/function_list.h
+++ b/lib/src/generated/function_list.h
@@ -5,7 +5,6 @@
// This file is auto-generated by scripts in the tools/ directory.
-
#ifndef DART_GL_LIB_SRC_GENERATED_FUNCTION_LIST_H_
#define DART_GL_LIB_SRC_GENERATED_FUNCTION_LIST_H_
@@ -16,7 +15,6 @@
Dart_NativeFunction function;
};
-extern const struct FunctionLookup *function_list;
+extern const struct FunctionLookup* function_list;
-#endif // DART_GL_LIB_SRC_GENERATED_FUNCTION_LIST_H_
-
+#endif // DART_GL_LIB_SRC_GENERATED_FUNCTION_LIST_H_
diff --git a/lib/src/generated/gl_bindings.cc b/lib/src/generated/gl_bindings.cc
index ed637bd..10db8cc 100644
--- a/lib/src/generated/gl_bindings.cc
+++ b/lib/src/generated/gl_bindings.cc
@@ -5,41 +5,42 @@
// This file is auto-generated by scripts in the tools/ directory.
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
-#include "GLES2/gl2.h"
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
-#include "util.h"
+#include "../util.h"
#include "gl_bindings.h"
// Generated GL function bindings for Dart.
void glActiveTexture_native(Dart_NativeArguments arguments) {
-TRACE_START(glActiveTexture_);
+ TRACE_START(glActiveTexture_);
int64_t texture;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &texture));
- glActiveTexture(texture);
+ glActiveTexture(texture);
-TRACE_END(glActiveTexture_);
+ TRACE_END(glActiveTexture_);
}
void glAttachShader_native(Dart_NativeArguments arguments) {
-TRACE_START(glAttachShader_);
+ TRACE_START(glAttachShader_);
int64_t program;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &program));
int64_t shader;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &shader));
- glAttachShader(program, shader);
+ glAttachShader(program, shader);
-TRACE_END(glAttachShader_);
+ TRACE_END(glAttachShader_);
}
void glBindAttribLocation_native(Dart_NativeArguments arguments) {
-TRACE_START(glBindAttribLocation_);
+ TRACE_START(glBindAttribLocation_);
int64_t program;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &program));
@@ -47,69 +48,70 @@
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &index));
void* name_peer = NULL;
- Dart_Handle name_arg = HANDLE(Dart_GetNativeStringArgument(arguments, 2, (void**)&name_peer));
- const char *name;
+ Dart_Handle name_arg =
+ HANDLE(Dart_GetNativeStringArgument(arguments, 2, (void**)&name_peer));
+ const char* name;
HANDLE(Dart_StringToCString(name_arg, &name));
- glBindAttribLocation(program, index, name);
+ glBindAttribLocation(program, index, name);
-TRACE_END(glBindAttribLocation_);
+ TRACE_END(glBindAttribLocation_);
}
void glBindBuffer_native(Dart_NativeArguments arguments) {
-TRACE_START(glBindBuffer_);
+ TRACE_START(glBindBuffer_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
int64_t buffer;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &buffer));
- glBindBuffer(target, buffer);
+ glBindBuffer(target, buffer);
-TRACE_END(glBindBuffer_);
+ TRACE_END(glBindBuffer_);
}
void glBindFramebuffer_native(Dart_NativeArguments arguments) {
-TRACE_START(glBindFramebuffer_);
+ TRACE_START(glBindFramebuffer_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
int64_t framebuffer;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &framebuffer));
- glBindFramebuffer(target, framebuffer);
+ glBindFramebuffer(target, framebuffer);
-TRACE_END(glBindFramebuffer_);
+ TRACE_END(glBindFramebuffer_);
}
void glBindRenderbuffer_native(Dart_NativeArguments arguments) {
-TRACE_START(glBindRenderbuffer_);
+ TRACE_START(glBindRenderbuffer_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
int64_t renderbuffer;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &renderbuffer));
- glBindRenderbuffer(target, renderbuffer);
+ glBindRenderbuffer(target, renderbuffer);
-TRACE_END(glBindRenderbuffer_);
+ TRACE_END(glBindRenderbuffer_);
}
void glBindTexture_native(Dart_NativeArguments arguments) {
-TRACE_START(glBindTexture_);
+ TRACE_START(glBindTexture_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
int64_t texture;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &texture));
- glBindTexture(target, texture);
+ glBindTexture(target, texture);
-TRACE_END(glBindTexture_);
+ TRACE_END(glBindTexture_);
}
void glBlendColor_native(Dart_NativeArguments arguments) {
-TRACE_START(glBlendColor_);
+ TRACE_START(glBlendColor_);
double red;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 0, &red));
@@ -122,49 +124,49 @@
double alpha;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 3, &alpha));
- glBlendColor(red, green, blue, alpha);
+ glBlendColor(red, green, blue, alpha);
-TRACE_END(glBlendColor_);
+ TRACE_END(glBlendColor_);
}
void glBlendEquation_native(Dart_NativeArguments arguments) {
-TRACE_START(glBlendEquation_);
+ TRACE_START(glBlendEquation_);
int64_t mode;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &mode));
- glBlendEquation(mode);
+ glBlendEquation(mode);
-TRACE_END(glBlendEquation_);
+ TRACE_END(glBlendEquation_);
}
void glBlendEquationSeparate_native(Dart_NativeArguments arguments) {
-TRACE_START(glBlendEquationSeparate_);
+ TRACE_START(glBlendEquationSeparate_);
int64_t modeRGB;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &modeRGB));
int64_t modeAlpha;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &modeAlpha));
- glBlendEquationSeparate(modeRGB, modeAlpha);
+ glBlendEquationSeparate(modeRGB, modeAlpha);
-TRACE_END(glBlendEquationSeparate_);
+ TRACE_END(glBlendEquationSeparate_);
}
void glBlendFunc_native(Dart_NativeArguments arguments) {
-TRACE_START(glBlendFunc_);
+ TRACE_START(glBlendFunc_);
int64_t sfactor;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &sfactor));
int64_t dfactor;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &dfactor));
- glBlendFunc(sfactor, dfactor);
+ glBlendFunc(sfactor, dfactor);
-TRACE_END(glBlendFunc_);
+ TRACE_END(glBlendFunc_);
}
void glBlendFuncSeparate_native(Dart_NativeArguments arguments) {
-TRACE_START(glBlendFuncSeparate_);
+ TRACE_START(glBlendFuncSeparate_);
int64_t sfactorRGB;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &sfactorRGB));
@@ -177,13 +179,13 @@
int64_t dfactorAlpha;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 3, &dfactorAlpha));
- glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
+ glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
-TRACE_END(glBlendFuncSeparate_);
+ TRACE_END(glBlendFuncSeparate_);
}
void glBufferData_native(Dart_NativeArguments arguments) {
-TRACE_START(glBufferData_);
+ TRACE_START(glBufferData_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
@@ -195,24 +197,25 @@
Dart_TypedData_Type data_typeddata_type;
intptr_t data_typeddata_length;
if (!Dart_IsNull(data_obj)) {
- HANDLE(Dart_TypedDataAcquireData(data_obj, &data_typeddata_type, &data_data, &data_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(data_obj, &data_typeddata_type, &data_data,
+ &data_typeddata_length));
}
const void* data = static_cast<const void*>(data_data);
int64_t usage;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 3, &usage));
- glBufferData(target, size, data, usage);
+ glBufferData(target, size, data, usage);
if (!Dart_IsNull(data_obj)) {
HANDLE(Dart_TypedDataReleaseData(data_obj));
}
-
-TRACE_END(glBufferData_);
+
+ TRACE_END(glBufferData_);
}
void glBufferSubData_native(Dart_NativeArguments arguments) {
-TRACE_START(glBufferSubData_);
+ TRACE_START(glBufferSubData_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
@@ -227,41 +230,42 @@
Dart_TypedData_Type data_typeddata_type;
intptr_t data_typeddata_length;
if (!Dart_IsNull(data_obj)) {
- HANDLE(Dart_TypedDataAcquireData(data_obj, &data_typeddata_type, &data_data, &data_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(data_obj, &data_typeddata_type, &data_data,
+ &data_typeddata_length));
}
const void* data = static_cast<const void*>(data_data);
- glBufferSubData(target, offset, size, data);
+ glBufferSubData(target, offset, size, data);
if (!Dart_IsNull(data_obj)) {
HANDLE(Dart_TypedDataReleaseData(data_obj));
}
-
-TRACE_END(glBufferSubData_);
+
+ TRACE_END(glBufferSubData_);
}
void glCheckFramebufferStatus_native(Dart_NativeArguments arguments) {
-TRACE_START(glCheckFramebufferStatus_);
+ TRACE_START(glCheckFramebufferStatus_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
-GLenum ret = glCheckFramebufferStatus(target);
-Dart_SetIntegerReturnValue(arguments, ret);
-TRACE_END(glCheckFramebufferStatus_);
+ GLenum ret = glCheckFramebufferStatus(target);
+ Dart_SetIntegerReturnValue(arguments, ret);
+ TRACE_END(glCheckFramebufferStatus_);
}
void glClear_native(Dart_NativeArguments arguments) {
-TRACE_START(glClear_);
+ TRACE_START(glClear_);
int64_t mask;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &mask));
- glClear(mask);
+ glClear(mask);
-TRACE_END(glClear_);
+ TRACE_END(glClear_);
}
void glClearColor_native(Dart_NativeArguments arguments) {
-TRACE_START(glClearColor_);
+ TRACE_START(glClearColor_);
double red;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 0, &red));
@@ -274,33 +278,33 @@
double alpha;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 3, &alpha));
- glClearColor(red, green, blue, alpha);
+ glClearColor(red, green, blue, alpha);
-TRACE_END(glClearColor_);
+ TRACE_END(glClearColor_);
}
void glClearDepthf_native(Dart_NativeArguments arguments) {
-TRACE_START(glClearDepthf_);
+ TRACE_START(glClearDepthf_);
double d;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 0, &d));
- glClearDepthf(d);
+ glClearDepthf(d);
-TRACE_END(glClearDepthf_);
+ TRACE_END(glClearDepthf_);
}
void glClearStencil_native(Dart_NativeArguments arguments) {
-TRACE_START(glClearStencil_);
+ TRACE_START(glClearStencil_);
int64_t s;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &s));
- glClearStencil(s);
+ glClearStencil(s);
-TRACE_END(glClearStencil_);
+ TRACE_END(glClearStencil_);
}
void glColorMask_native(Dart_NativeArguments arguments) {
-TRACE_START(glColorMask_);
+ TRACE_START(glColorMask_);
int64_t red;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &red));
@@ -313,23 +317,23 @@
int64_t alpha;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 3, &alpha));
- glColorMask(red, green, blue, alpha);
+ glColorMask(red, green, blue, alpha);
-TRACE_END(glColorMask_);
+ TRACE_END(glColorMask_);
}
void glCompileShader_native(Dart_NativeArguments arguments) {
-TRACE_START(glCompileShader_);
+ TRACE_START(glCompileShader_);
int64_t shader;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &shader));
- glCompileShader(shader);
+ glCompileShader(shader);
-TRACE_END(glCompileShader_);
+ TRACE_END(glCompileShader_);
}
void glCompressedTexImage2D_native(Dart_NativeArguments arguments) {
-TRACE_START(glCompressedTexImage2D_);
+ TRACE_START(glCompressedTexImage2D_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
@@ -356,21 +360,23 @@
Dart_TypedData_Type data_typeddata_type;
intptr_t data_typeddata_length;
if (!Dart_IsNull(data_obj)) {
- HANDLE(Dart_TypedDataAcquireData(data_obj, &data_typeddata_type, &data_data, &data_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(data_obj, &data_typeddata_type, &data_data,
+ &data_typeddata_length));
}
const void* data = static_cast<const void*>(data_data);
- glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
+ glCompressedTexImage2D(target, level, internalformat, width, height, border,
+ imageSize, data);
if (!Dart_IsNull(data_obj)) {
HANDLE(Dart_TypedDataReleaseData(data_obj));
}
-
-TRACE_END(glCompressedTexImage2D_);
+
+ TRACE_END(glCompressedTexImage2D_);
}
void glCompressedTexSubImage2D_native(Dart_NativeArguments arguments) {
-TRACE_START(glCompressedTexSubImage2D_);
+ TRACE_START(glCompressedTexSubImage2D_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
@@ -400,21 +406,23 @@
Dart_TypedData_Type data_typeddata_type;
intptr_t data_typeddata_length;
if (!Dart_IsNull(data_obj)) {
- HANDLE(Dart_TypedDataAcquireData(data_obj, &data_typeddata_type, &data_data, &data_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(data_obj, &data_typeddata_type, &data_data,
+ &data_typeddata_length));
}
const void* data = static_cast<const void*>(data_data);
- glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
+ glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height,
+ format, imageSize, data);
if (!Dart_IsNull(data_obj)) {
HANDLE(Dart_TypedDataReleaseData(data_obj));
}
-
-TRACE_END(glCompressedTexSubImage2D_);
+
+ TRACE_END(glCompressedTexSubImage2D_);
}
void glCopyTexImage2D_native(Dart_NativeArguments arguments) {
-TRACE_START(glCopyTexImage2D_);
+ TRACE_START(glCopyTexImage2D_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
@@ -439,13 +447,13 @@
int64_t border;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 7, &border));
- glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+ glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
-TRACE_END(glCopyTexImage2D_);
+ TRACE_END(glCopyTexImage2D_);
}
void glCopyTexSubImage2D_native(Dart_NativeArguments arguments) {
-TRACE_START(glCopyTexSubImage2D_);
+ TRACE_START(glCopyTexSubImage2D_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
@@ -470,126 +478,194 @@
int64_t height;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 7, &height));
- glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+ glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
-TRACE_END(glCopyTexSubImage2D_);
+ TRACE_END(glCopyTexSubImage2D_);
}
void glCreateProgram_native(Dart_NativeArguments arguments) {
-TRACE_START(glCreateProgram_);
-GLuint ret = glCreateProgram();
-Dart_SetIntegerReturnValue(arguments, ret);
-TRACE_END(glCreateProgram_);
+ TRACE_START(glCreateProgram_);
+ GLuint ret = glCreateProgram();
+ Dart_SetIntegerReturnValue(arguments, ret);
+ TRACE_END(glCreateProgram_);
}
void glCreateShader_native(Dart_NativeArguments arguments) {
-TRACE_START(glCreateShader_);
+ TRACE_START(glCreateShader_);
int64_t type;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &type));
-GLuint ret = glCreateShader(type);
-Dart_SetIntegerReturnValue(arguments, ret);
-TRACE_END(glCreateShader_);
+ GLuint ret = glCreateShader(type);
+ Dart_SetIntegerReturnValue(arguments, ret);
+ TRACE_END(glCreateShader_);
}
void glCullFace_native(Dart_NativeArguments arguments) {
-TRACE_START(glCullFace_);
+ TRACE_START(glCullFace_);
int64_t mode;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &mode));
- glCullFace(mode);
+ glCullFace(mode);
-TRACE_END(glCullFace_);
+ TRACE_END(glCullFace_);
+}
+
+void glDeleteBuffers_native(Dart_NativeArguments arguments) {
+ TRACE_START(glDeleteBuffers_);
+ Dart_Handle values_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
+ GLuint* values = NULL;
+ intptr_t n = 0;
+ HANDLE(Dart_ListLength(values_obj, &n));
+ values = static_cast<GLuint*>(malloc(sizeof(GLuint) * n));
+ for (int i = 0; i < n; i++) {
+ Dart_Handle i_obj = HANDLE(Dart_ListGetAt(values_obj, i));
+ HANDLE(Dart_IntegerToUInt(i_obj, &values[i]));
+ }
+ glDeleteBuffers(n, values);
+ free(values);
+
+ TRACE_END(glDeleteBuffers_);
+}
+
+void glDeleteFramebuffers_native(Dart_NativeArguments arguments) {
+ TRACE_START(glDeleteFramebuffers_);
+ Dart_Handle values_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
+ GLuint* values = NULL;
+ intptr_t n = 0;
+ HANDLE(Dart_ListLength(values_obj, &n));
+ values = static_cast<GLuint*>(malloc(sizeof(GLuint) * n));
+ for (int i = 0; i < n; i++) {
+ Dart_Handle i_obj = HANDLE(Dart_ListGetAt(values_obj, i));
+ HANDLE(Dart_IntegerToUInt(i_obj, &values[i]));
+ }
+ glDeleteFramebuffers(n, values);
+ free(values);
+
+ TRACE_END(glDeleteFramebuffers_);
}
void glDeleteProgram_native(Dart_NativeArguments arguments) {
-TRACE_START(glDeleteProgram_);
+ TRACE_START(glDeleteProgram_);
int64_t program;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &program));
- glDeleteProgram(program);
+ glDeleteProgram(program);
-TRACE_END(glDeleteProgram_);
+ TRACE_END(glDeleteProgram_);
+}
+
+void glDeleteRenderbuffers_native(Dart_NativeArguments arguments) {
+ TRACE_START(glDeleteRenderbuffers_);
+ Dart_Handle values_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
+ GLuint* values = NULL;
+ intptr_t n = 0;
+ HANDLE(Dart_ListLength(values_obj, &n));
+ values = static_cast<GLuint*>(malloc(sizeof(GLuint) * n));
+ for (int i = 0; i < n; i++) {
+ Dart_Handle i_obj = HANDLE(Dart_ListGetAt(values_obj, i));
+ HANDLE(Dart_IntegerToUInt(i_obj, &values[i]));
+ }
+ glDeleteRenderbuffers(n, values);
+ free(values);
+
+ TRACE_END(glDeleteRenderbuffers_);
}
void glDeleteShader_native(Dart_NativeArguments arguments) {
-TRACE_START(glDeleteShader_);
+ TRACE_START(glDeleteShader_);
int64_t shader;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &shader));
- glDeleteShader(shader);
+ glDeleteShader(shader);
-TRACE_END(glDeleteShader_);
+ TRACE_END(glDeleteShader_);
+}
+
+void glDeleteTextures_native(Dart_NativeArguments arguments) {
+ TRACE_START(glDeleteTextures_);
+ Dart_Handle values_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
+ GLuint* values = NULL;
+ intptr_t n = 0;
+ HANDLE(Dart_ListLength(values_obj, &n));
+ values = static_cast<GLuint*>(malloc(sizeof(GLuint) * n));
+ for (int i = 0; i < n; i++) {
+ Dart_Handle i_obj = HANDLE(Dart_ListGetAt(values_obj, i));
+ HANDLE(Dart_IntegerToUInt(i_obj, &values[i]));
+ }
+ glDeleteTextures(n, values);
+ free(values);
+
+ TRACE_END(glDeleteTextures_);
}
void glDepthFunc_native(Dart_NativeArguments arguments) {
-TRACE_START(glDepthFunc_);
+ TRACE_START(glDepthFunc_);
int64_t func;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &func));
- glDepthFunc(func);
+ glDepthFunc(func);
-TRACE_END(glDepthFunc_);
+ TRACE_END(glDepthFunc_);
}
void glDepthMask_native(Dart_NativeArguments arguments) {
-TRACE_START(glDepthMask_);
+ TRACE_START(glDepthMask_);
int64_t flag;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &flag));
- glDepthMask(flag);
+ glDepthMask(flag);
-TRACE_END(glDepthMask_);
+ TRACE_END(glDepthMask_);
}
void glDepthRangef_native(Dart_NativeArguments arguments) {
-TRACE_START(glDepthRangef_);
+ TRACE_START(glDepthRangef_);
double n;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 0, &n));
double f;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 1, &f));
- glDepthRangef(n, f);
+ glDepthRangef(n, f);
-TRACE_END(glDepthRangef_);
+ TRACE_END(glDepthRangef_);
}
void glDetachShader_native(Dart_NativeArguments arguments) {
-TRACE_START(glDetachShader_);
+ TRACE_START(glDetachShader_);
int64_t program;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &program));
int64_t shader;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &shader));
- glDetachShader(program, shader);
+ glDetachShader(program, shader);
-TRACE_END(glDetachShader_);
+ TRACE_END(glDetachShader_);
}
void glDisable_native(Dart_NativeArguments arguments) {
-TRACE_START(glDisable_);
+ TRACE_START(glDisable_);
int64_t cap;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &cap));
- glDisable(cap);
+ glDisable(cap);
-TRACE_END(glDisable_);
+ TRACE_END(glDisable_);
}
void glDisableVertexAttribArray_native(Dart_NativeArguments arguments) {
-TRACE_START(glDisableVertexAttribArray_);
+ TRACE_START(glDisableVertexAttribArray_);
int64_t index;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &index));
- glDisableVertexAttribArray(index);
+ glDisableVertexAttribArray(index);
-TRACE_END(glDisableVertexAttribArray_);
+ TRACE_END(glDisableVertexAttribArray_);
}
void glDrawArrays_native(Dart_NativeArguments arguments) {
-TRACE_START(glDrawArrays_);
+ TRACE_START(glDrawArrays_);
int64_t mode;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &mode));
@@ -599,13 +675,13 @@
int64_t count;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 2, &count));
- glDrawArrays(mode, first, count);
+ glDrawArrays(mode, first, count);
-TRACE_END(glDrawArrays_);
+ TRACE_END(glDrawArrays_);
}
void glDrawElements_native(Dart_NativeArguments arguments) {
-TRACE_START(glDrawElements_);
+ TRACE_START(glDrawElements_);
int64_t mode;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &mode));
@@ -620,55 +696,56 @@
Dart_TypedData_Type indices_typeddata_type;
intptr_t indices_typeddata_length;
if (!Dart_IsNull(indices_obj)) {
- HANDLE(Dart_TypedDataAcquireData(indices_obj, &indices_typeddata_type, &indices_data, &indices_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(indices_obj, &indices_typeddata_type,
+ &indices_data, &indices_typeddata_length));
}
const void* indices = static_cast<const void*>(indices_data);
- glDrawElements(mode, count, type, indices);
+ glDrawElements(mode, count, type, indices);
if (!Dart_IsNull(indices_obj)) {
HANDLE(Dart_TypedDataReleaseData(indices_obj));
}
-
-TRACE_END(glDrawElements_);
+
+ TRACE_END(glDrawElements_);
}
void glEnable_native(Dart_NativeArguments arguments) {
-TRACE_START(glEnable_);
+ TRACE_START(glEnable_);
int64_t cap;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &cap));
- glEnable(cap);
+ glEnable(cap);
-TRACE_END(glEnable_);
+ TRACE_END(glEnable_);
}
void glEnableVertexAttribArray_native(Dart_NativeArguments arguments) {
-TRACE_START(glEnableVertexAttribArray_);
+ TRACE_START(glEnableVertexAttribArray_);
int64_t index;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &index));
- glEnableVertexAttribArray(index);
+ glEnableVertexAttribArray(index);
-TRACE_END(glEnableVertexAttribArray_);
+ TRACE_END(glEnableVertexAttribArray_);
}
void glFinish_native(Dart_NativeArguments arguments) {
-TRACE_START(glFinish_);
- glFinish();
+ TRACE_START(glFinish_);
+ glFinish();
-TRACE_END(glFinish_);
+ TRACE_END(glFinish_);
}
void glFlush_native(Dart_NativeArguments arguments) {
-TRACE_START(glFlush_);
- glFlush();
+ TRACE_START(glFlush_);
+ glFlush();
-TRACE_END(glFlush_);
+ TRACE_END(glFlush_);
}
void glFramebufferRenderbuffer_native(Dart_NativeArguments arguments) {
-TRACE_START(glFramebufferRenderbuffer_);
+ TRACE_START(glFramebufferRenderbuffer_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
@@ -681,13 +758,14 @@
int64_t renderbuffer;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 3, &renderbuffer));
- glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+ glFramebufferRenderbuffer(target, attachment, renderbuffertarget,
+ renderbuffer);
-TRACE_END(glFramebufferRenderbuffer_);
+ TRACE_END(glFramebufferRenderbuffer_);
}
void glFramebufferTexture2D_native(Dart_NativeArguments arguments) {
-TRACE_START(glFramebufferTexture2D_);
+ TRACE_START(glFramebufferTexture2D_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
@@ -703,216 +781,292 @@
int64_t level;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 4, &level));
- glFramebufferTexture2D(target, attachment, textarget, texture, level);
+ glFramebufferTexture2D(target, attachment, textarget, texture, level);
-TRACE_END(glFramebufferTexture2D_);
+ TRACE_END(glFramebufferTexture2D_);
}
void glFrontFace_native(Dart_NativeArguments arguments) {
-TRACE_START(glFrontFace_);
+ TRACE_START(glFrontFace_);
int64_t mode;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &mode));
- glFrontFace(mode);
+ glFrontFace(mode);
-TRACE_END(glFrontFace_);
+ TRACE_END(glFrontFace_);
+}
+
+void glGenBuffers_native(Dart_NativeArguments arguments) {
+ TRACE_START(glGenBuffers_);
+ int64_t n;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &n));
+
+ GLuint* values = static_cast<GLuint*>(malloc(sizeof(GLuint) * n));
+ glGenBuffers(n, values);
+ Dart_Handle values_obj = Dart_NewList(n);
+ for (int i = 0; i < n; i++) {
+ Dart_Handle i_obj = HANDLE(Dart_NewInteger(values[i]));
+ HANDLE(Dart_ListSetAt(values_obj, i, i_obj));
+ }
+ Dart_SetReturnValue(arguments, values_obj);
+ free(values);
+
+ TRACE_END(glGenBuffers_);
}
void glGenerateMipmap_native(Dart_NativeArguments arguments) {
-TRACE_START(glGenerateMipmap_);
+ TRACE_START(glGenerateMipmap_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
- glGenerateMipmap(target);
+ glGenerateMipmap(target);
-TRACE_END(glGenerateMipmap_);
+ TRACE_END(glGenerateMipmap_);
+}
+
+void glGenFramebuffers_native(Dart_NativeArguments arguments) {
+ TRACE_START(glGenFramebuffers_);
+ int64_t n;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &n));
+
+ GLuint* values = static_cast<GLuint*>(malloc(sizeof(GLuint) * n));
+ glGenFramebuffers(n, values);
+ Dart_Handle values_obj = Dart_NewList(n);
+ for (int i = 0; i < n; i++) {
+ Dart_Handle i_obj = HANDLE(Dart_NewInteger(values[i]));
+ HANDLE(Dart_ListSetAt(values_obj, i, i_obj));
+ }
+ Dart_SetReturnValue(arguments, values_obj);
+ free(values);
+
+ TRACE_END(glGenFramebuffers_);
+}
+
+void glGenRenderbuffers_native(Dart_NativeArguments arguments) {
+ TRACE_START(glGenRenderbuffers_);
+ int64_t n;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &n));
+
+ GLuint* values = static_cast<GLuint*>(malloc(sizeof(GLuint) * n));
+ glGenRenderbuffers(n, values);
+ Dart_Handle values_obj = Dart_NewList(n);
+ for (int i = 0; i < n; i++) {
+ Dart_Handle i_obj = HANDLE(Dart_NewInteger(values[i]));
+ HANDLE(Dart_ListSetAt(values_obj, i, i_obj));
+ }
+ Dart_SetReturnValue(arguments, values_obj);
+ free(values);
+
+ TRACE_END(glGenRenderbuffers_);
+}
+
+void glGenTextures_native(Dart_NativeArguments arguments) {
+ TRACE_START(glGenTextures_);
+ int64_t n;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &n));
+
+ GLuint* values = static_cast<GLuint*>(malloc(sizeof(GLuint) * n));
+ glGenTextures(n, values);
+ Dart_Handle values_obj = Dart_NewList(n);
+ for (int i = 0; i < n; i++) {
+ Dart_Handle i_obj = HANDLE(Dart_NewInteger(values[i]));
+ HANDLE(Dart_ListSetAt(values_obj, i, i_obj));
+ }
+ Dart_SetReturnValue(arguments, values_obj);
+ free(values);
+
+ TRACE_END(glGenTextures_);
}
void glGetAttribLocation_native(Dart_NativeArguments arguments) {
-TRACE_START(glGetAttribLocation_);
+ TRACE_START(glGetAttribLocation_);
int64_t program;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &program));
void* name_peer = NULL;
- Dart_Handle name_arg = HANDLE(Dart_GetNativeStringArgument(arguments, 1, (void**)&name_peer));
- const char *name;
+ Dart_Handle name_arg =
+ HANDLE(Dart_GetNativeStringArgument(arguments, 1, (void**)&name_peer));
+ const char* name;
HANDLE(Dart_StringToCString(name_arg, &name));
-GLint ret = glGetAttribLocation(program, name);
-Dart_SetIntegerReturnValue(arguments, ret);
-TRACE_END(glGetAttribLocation_);
+ GLint ret = glGetAttribLocation(program, name);
+ Dart_SetIntegerReturnValue(arguments, ret);
+ TRACE_END(glGetAttribLocation_);
}
void glGetError_native(Dart_NativeArguments arguments) {
-TRACE_START(glGetError_);
-GLenum ret = glGetError();
-Dart_SetIntegerReturnValue(arguments, ret);
-TRACE_END(glGetError_);
+ TRACE_START(glGetError_);
+ GLenum ret = glGetError();
+ Dart_SetIntegerReturnValue(arguments, ret);
+ TRACE_END(glGetError_);
}
void glGetString_native(Dart_NativeArguments arguments) {
-TRACE_START(glGetString_);
+ TRACE_START(glGetString_);
int64_t name;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &name));
-const GLubyte* ret = glGetString(name);
-Dart_SetReturnValue(arguments, HANDLE(Dart_NewStringFromCString(reinterpret_cast<const char *>(ret))));
-TRACE_END(glGetString_);
+ const GLubyte* ret = glGetString(name);
+ Dart_SetReturnValue(
+ arguments,
+ HANDLE(Dart_NewStringFromCString(reinterpret_cast<const char*>(ret))));
+ TRACE_END(glGetString_);
}
void glGetUniformLocation_native(Dart_NativeArguments arguments) {
-TRACE_START(glGetUniformLocation_);
+ TRACE_START(glGetUniformLocation_);
int64_t program;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &program));
void* name_peer = NULL;
- Dart_Handle name_arg = HANDLE(Dart_GetNativeStringArgument(arguments, 1, (void**)&name_peer));
- const char *name;
+ Dart_Handle name_arg =
+ HANDLE(Dart_GetNativeStringArgument(arguments, 1, (void**)&name_peer));
+ const char* name;
HANDLE(Dart_StringToCString(name_arg, &name));
-GLint ret = glGetUniformLocation(program, name);
-Dart_SetIntegerReturnValue(arguments, ret);
-TRACE_END(glGetUniformLocation_);
+ GLint ret = glGetUniformLocation(program, name);
+ Dart_SetIntegerReturnValue(arguments, ret);
+ TRACE_END(glGetUniformLocation_);
}
void glHint_native(Dart_NativeArguments arguments) {
-TRACE_START(glHint_);
+ TRACE_START(glHint_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
int64_t mode;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &mode));
- glHint(target, mode);
+ glHint(target, mode);
-TRACE_END(glHint_);
+ TRACE_END(glHint_);
}
void glIsBuffer_native(Dart_NativeArguments arguments) {
-TRACE_START(glIsBuffer_);
+ TRACE_START(glIsBuffer_);
int64_t buffer;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &buffer));
-GLboolean ret = glIsBuffer(buffer);
-Dart_SetBooleanReturnValue(arguments, ret);
-TRACE_END(glIsBuffer_);
+ GLboolean ret = glIsBuffer(buffer);
+ Dart_SetBooleanReturnValue(arguments, ret);
+ TRACE_END(glIsBuffer_);
}
void glIsEnabled_native(Dart_NativeArguments arguments) {
-TRACE_START(glIsEnabled_);
+ TRACE_START(glIsEnabled_);
int64_t cap;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &cap));
-GLboolean ret = glIsEnabled(cap);
-Dart_SetBooleanReturnValue(arguments, ret);
-TRACE_END(glIsEnabled_);
+ GLboolean ret = glIsEnabled(cap);
+ Dart_SetBooleanReturnValue(arguments, ret);
+ TRACE_END(glIsEnabled_);
}
void glIsFramebuffer_native(Dart_NativeArguments arguments) {
-TRACE_START(glIsFramebuffer_);
+ TRACE_START(glIsFramebuffer_);
int64_t framebuffer;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &framebuffer));
-GLboolean ret = glIsFramebuffer(framebuffer);
-Dart_SetBooleanReturnValue(arguments, ret);
-TRACE_END(glIsFramebuffer_);
+ GLboolean ret = glIsFramebuffer(framebuffer);
+ Dart_SetBooleanReturnValue(arguments, ret);
+ TRACE_END(glIsFramebuffer_);
}
void glIsProgram_native(Dart_NativeArguments arguments) {
-TRACE_START(glIsProgram_);
+ TRACE_START(glIsProgram_);
int64_t program;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &program));
-GLboolean ret = glIsProgram(program);
-Dart_SetBooleanReturnValue(arguments, ret);
-TRACE_END(glIsProgram_);
+ GLboolean ret = glIsProgram(program);
+ Dart_SetBooleanReturnValue(arguments, ret);
+ TRACE_END(glIsProgram_);
}
void glIsRenderbuffer_native(Dart_NativeArguments arguments) {
-TRACE_START(glIsRenderbuffer_);
+ TRACE_START(glIsRenderbuffer_);
int64_t renderbuffer;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &renderbuffer));
-GLboolean ret = glIsRenderbuffer(renderbuffer);
-Dart_SetBooleanReturnValue(arguments, ret);
-TRACE_END(glIsRenderbuffer_);
+ GLboolean ret = glIsRenderbuffer(renderbuffer);
+ Dart_SetBooleanReturnValue(arguments, ret);
+ TRACE_END(glIsRenderbuffer_);
}
void glIsShader_native(Dart_NativeArguments arguments) {
-TRACE_START(glIsShader_);
+ TRACE_START(glIsShader_);
int64_t shader;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &shader));
-GLboolean ret = glIsShader(shader);
-Dart_SetBooleanReturnValue(arguments, ret);
-TRACE_END(glIsShader_);
+ GLboolean ret = glIsShader(shader);
+ Dart_SetBooleanReturnValue(arguments, ret);
+ TRACE_END(glIsShader_);
}
void glIsTexture_native(Dart_NativeArguments arguments) {
-TRACE_START(glIsTexture_);
+ TRACE_START(glIsTexture_);
int64_t texture;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &texture));
-GLboolean ret = glIsTexture(texture);
-Dart_SetBooleanReturnValue(arguments, ret);
-TRACE_END(glIsTexture_);
+ GLboolean ret = glIsTexture(texture);
+ Dart_SetBooleanReturnValue(arguments, ret);
+ TRACE_END(glIsTexture_);
}
void glLineWidth_native(Dart_NativeArguments arguments) {
-TRACE_START(glLineWidth_);
+ TRACE_START(glLineWidth_);
double width;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 0, &width));
- glLineWidth(width);
+ glLineWidth(width);
-TRACE_END(glLineWidth_);
+ TRACE_END(glLineWidth_);
}
void glLinkProgram_native(Dart_NativeArguments arguments) {
-TRACE_START(glLinkProgram_);
+ TRACE_START(glLinkProgram_);
int64_t program;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &program));
- glLinkProgram(program);
+ glLinkProgram(program);
-TRACE_END(glLinkProgram_);
+ TRACE_END(glLinkProgram_);
}
void glPixelStorei_native(Dart_NativeArguments arguments) {
-TRACE_START(glPixelStorei_);
+ TRACE_START(glPixelStorei_);
int64_t pname;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &pname));
int64_t param;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, ¶m));
- glPixelStorei(pname, param);
+ glPixelStorei(pname, param);
-TRACE_END(glPixelStorei_);
+ TRACE_END(glPixelStorei_);
}
void glPolygonOffset_native(Dart_NativeArguments arguments) {
-TRACE_START(glPolygonOffset_);
+ TRACE_START(glPolygonOffset_);
double factor;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 0, &factor));
double units;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 1, &units));
- glPolygonOffset(factor, units);
+ glPolygonOffset(factor, units);
-TRACE_END(glPolygonOffset_);
+ TRACE_END(glPolygonOffset_);
}
void glReleaseShaderCompiler_native(Dart_NativeArguments arguments) {
-TRACE_START(glReleaseShaderCompiler_);
- glReleaseShaderCompiler();
+ TRACE_START(glReleaseShaderCompiler_);
+ glReleaseShaderCompiler();
-TRACE_END(glReleaseShaderCompiler_);
+ TRACE_END(glReleaseShaderCompiler_);
}
void glRenderbufferStorage_native(Dart_NativeArguments arguments) {
-TRACE_START(glRenderbufferStorage_);
+ TRACE_START(glRenderbufferStorage_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
@@ -925,26 +1079,26 @@
int64_t height;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 3, &height));
- glRenderbufferStorage(target, internalformat, width, height);
+ glRenderbufferStorage(target, internalformat, width, height);
-TRACE_END(glRenderbufferStorage_);
+ TRACE_END(glRenderbufferStorage_);
}
void glSampleCoverage_native(Dart_NativeArguments arguments) {
-TRACE_START(glSampleCoverage_);
+ TRACE_START(glSampleCoverage_);
double value;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 0, &value));
int64_t invert;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &invert));
- glSampleCoverage(value, invert);
+ glSampleCoverage(value, invert);
-TRACE_END(glSampleCoverage_);
+ TRACE_END(glSampleCoverage_);
}
void glScissor_native(Dart_NativeArguments arguments) {
-TRACE_START(glScissor_);
+ TRACE_START(glScissor_);
int64_t x;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &x));
@@ -957,13 +1111,13 @@
int64_t height;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 3, &height));
- glScissor(x, y, width, height);
+ glScissor(x, y, width, height);
-TRACE_END(glScissor_);
+ TRACE_END(glScissor_);
}
void glStencilFunc_native(Dart_NativeArguments arguments) {
-TRACE_START(glStencilFunc_);
+ TRACE_START(glStencilFunc_);
int64_t func;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &func));
@@ -973,13 +1127,13 @@
int64_t mask;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 2, &mask));
- glStencilFunc(func, ref, mask);
+ glStencilFunc(func, ref, mask);
-TRACE_END(glStencilFunc_);
+ TRACE_END(glStencilFunc_);
}
void glStencilFuncSeparate_native(Dart_NativeArguments arguments) {
-TRACE_START(glStencilFuncSeparate_);
+ TRACE_START(glStencilFuncSeparate_);
int64_t face;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &face));
@@ -992,36 +1146,36 @@
int64_t mask;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 3, &mask));
- glStencilFuncSeparate(face, func, ref, mask);
+ glStencilFuncSeparate(face, func, ref, mask);
-TRACE_END(glStencilFuncSeparate_);
+ TRACE_END(glStencilFuncSeparate_);
}
void glStencilMask_native(Dart_NativeArguments arguments) {
-TRACE_START(glStencilMask_);
+ TRACE_START(glStencilMask_);
int64_t mask;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &mask));
- glStencilMask(mask);
+ glStencilMask(mask);
-TRACE_END(glStencilMask_);
+ TRACE_END(glStencilMask_);
}
void glStencilMaskSeparate_native(Dart_NativeArguments arguments) {
-TRACE_START(glStencilMaskSeparate_);
+ TRACE_START(glStencilMaskSeparate_);
int64_t face;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &face));
int64_t mask;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &mask));
- glStencilMaskSeparate(face, mask);
+ glStencilMaskSeparate(face, mask);
-TRACE_END(glStencilMaskSeparate_);
+ TRACE_END(glStencilMaskSeparate_);
}
void glStencilOp_native(Dart_NativeArguments arguments) {
-TRACE_START(glStencilOp_);
+ TRACE_START(glStencilOp_);
int64_t fail;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &fail));
@@ -1031,13 +1185,13 @@
int64_t zpass;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 2, &zpass));
- glStencilOp(fail, zfail, zpass);
+ glStencilOp(fail, zfail, zpass);
-TRACE_END(glStencilOp_);
+ TRACE_END(glStencilOp_);
}
void glStencilOpSeparate_native(Dart_NativeArguments arguments) {
-TRACE_START(glStencilOpSeparate_);
+ TRACE_START(glStencilOpSeparate_);
int64_t face;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &face));
@@ -1050,13 +1204,13 @@
int64_t dppass;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 3, &dppass));
- glStencilOpSeparate(face, sfail, dpfail, dppass);
+ glStencilOpSeparate(face, sfail, dpfail, dppass);
-TRACE_END(glStencilOpSeparate_);
+ TRACE_END(glStencilOpSeparate_);
}
void glTexImage2D_native(Dart_NativeArguments arguments) {
-TRACE_START(glTexImage2D_);
+ TRACE_START(glTexImage2D_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
@@ -1086,21 +1240,23 @@
Dart_TypedData_Type pixels_typeddata_type;
intptr_t pixels_typeddata_length;
if (!Dart_IsNull(pixels_obj)) {
- HANDLE(Dart_TypedDataAcquireData(pixels_obj, &pixels_typeddata_type, &pixels_data, &pixels_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(pixels_obj, &pixels_typeddata_type,
+ &pixels_data, &pixels_typeddata_length));
}
const void* pixels = static_cast<const void*>(pixels_data);
- glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+ glTexImage2D(target, level, internalformat, width, height, border, format,
+ type, pixels);
if (!Dart_IsNull(pixels_obj)) {
HANDLE(Dart_TypedDataReleaseData(pixels_obj));
}
-
-TRACE_END(glTexImage2D_);
+
+ TRACE_END(glTexImage2D_);
}
void glTexParameterf_native(Dart_NativeArguments arguments) {
-TRACE_START(glTexParameterf_);
+ TRACE_START(glTexParameterf_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
@@ -1110,13 +1266,13 @@
double param;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 2, ¶m));
- glTexParameterf(target, pname, param);
+ glTexParameterf(target, pname, param);
-TRACE_END(glTexParameterf_);
+ TRACE_END(glTexParameterf_);
}
void glTexParameteri_native(Dart_NativeArguments arguments) {
-TRACE_START(glTexParameteri_);
+ TRACE_START(glTexParameteri_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
@@ -1126,13 +1282,13 @@
int64_t param;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 2, ¶m));
- glTexParameteri(target, pname, param);
+ glTexParameteri(target, pname, param);
-TRACE_END(glTexParameteri_);
+ TRACE_END(glTexParameteri_);
}
void glTexSubImage2D_native(Dart_NativeArguments arguments) {
-TRACE_START(glTexSubImage2D_);
+ TRACE_START(glTexSubImage2D_);
int64_t target;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
@@ -1162,34 +1318,36 @@
Dart_TypedData_Type pixels_typeddata_type;
intptr_t pixels_typeddata_length;
if (!Dart_IsNull(pixels_obj)) {
- HANDLE(Dart_TypedDataAcquireData(pixels_obj, &pixels_typeddata_type, &pixels_data, &pixels_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(pixels_obj, &pixels_typeddata_type,
+ &pixels_data, &pixels_typeddata_length));
}
const void* pixels = static_cast<const void*>(pixels_data);
- glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+ glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
+ pixels);
if (!Dart_IsNull(pixels_obj)) {
HANDLE(Dart_TypedDataReleaseData(pixels_obj));
}
-
-TRACE_END(glTexSubImage2D_);
+
+ TRACE_END(glTexSubImage2D_);
}
void glUniform1f_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform1f_);
+ TRACE_START(glUniform1f_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
double v0;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 1, &v0));
- glUniform1f(location, v0);
+ glUniform1f(location, v0);
-TRACE_END(glUniform1f_);
+ TRACE_END(glUniform1f_);
}
void glUniform1fv_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform1fv_);
+ TRACE_START(glUniform1fv_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1201,34 +1359,35 @@
Dart_TypedData_Type value_typeddata_type;
intptr_t value_typeddata_length;
if (!Dart_IsNull(value_obj)) {
- HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type, &value_data, &value_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type,
+ &value_data, &value_typeddata_length));
}
const GLfloat* value = static_cast<const GLfloat*>(value_data);
- glUniform1fv(location, count, value);
+ glUniform1fv(location, count, value);
if (!Dart_IsNull(value_obj)) {
HANDLE(Dart_TypedDataReleaseData(value_obj));
}
-
-TRACE_END(glUniform1fv_);
+
+ TRACE_END(glUniform1fv_);
}
void glUniform1i_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform1i_);
+ TRACE_START(glUniform1i_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
int64_t v0;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &v0));
- glUniform1i(location, v0);
+ glUniform1i(location, v0);
-TRACE_END(glUniform1i_);
+ TRACE_END(glUniform1i_);
}
void glUniform1iv_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform1iv_);
+ TRACE_START(glUniform1iv_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1240,21 +1399,22 @@
Dart_TypedData_Type value_typeddata_type;
intptr_t value_typeddata_length;
if (!Dart_IsNull(value_obj)) {
- HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type, &value_data, &value_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type,
+ &value_data, &value_typeddata_length));
}
const GLint* value = static_cast<const GLint*>(value_data);
- glUniform1iv(location, count, value);
+ glUniform1iv(location, count, value);
if (!Dart_IsNull(value_obj)) {
HANDLE(Dart_TypedDataReleaseData(value_obj));
}
-
-TRACE_END(glUniform1iv_);
+
+ TRACE_END(glUniform1iv_);
}
void glUniform2f_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform2f_);
+ TRACE_START(glUniform2f_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1264,13 +1424,13 @@
double v1;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 2, &v1));
- glUniform2f(location, v0, v1);
+ glUniform2f(location, v0, v1);
-TRACE_END(glUniform2f_);
+ TRACE_END(glUniform2f_);
}
void glUniform2fv_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform2fv_);
+ TRACE_START(glUniform2fv_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1282,21 +1442,22 @@
Dart_TypedData_Type value_typeddata_type;
intptr_t value_typeddata_length;
if (!Dart_IsNull(value_obj)) {
- HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type, &value_data, &value_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type,
+ &value_data, &value_typeddata_length));
}
const GLfloat* value = static_cast<const GLfloat*>(value_data);
- glUniform2fv(location, count, value);
+ glUniform2fv(location, count, value);
if (!Dart_IsNull(value_obj)) {
HANDLE(Dart_TypedDataReleaseData(value_obj));
}
-
-TRACE_END(glUniform2fv_);
+
+ TRACE_END(glUniform2fv_);
}
void glUniform2i_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform2i_);
+ TRACE_START(glUniform2i_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1306,13 +1467,13 @@
int64_t v1;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 2, &v1));
- glUniform2i(location, v0, v1);
+ glUniform2i(location, v0, v1);
-TRACE_END(glUniform2i_);
+ TRACE_END(glUniform2i_);
}
void glUniform2iv_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform2iv_);
+ TRACE_START(glUniform2iv_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1324,21 +1485,22 @@
Dart_TypedData_Type value_typeddata_type;
intptr_t value_typeddata_length;
if (!Dart_IsNull(value_obj)) {
- HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type, &value_data, &value_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type,
+ &value_data, &value_typeddata_length));
}
const GLint* value = static_cast<const GLint*>(value_data);
- glUniform2iv(location, count, value);
+ glUniform2iv(location, count, value);
if (!Dart_IsNull(value_obj)) {
HANDLE(Dart_TypedDataReleaseData(value_obj));
}
-
-TRACE_END(glUniform2iv_);
+
+ TRACE_END(glUniform2iv_);
}
void glUniform3f_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform3f_);
+ TRACE_START(glUniform3f_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1351,13 +1513,13 @@
double v2;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 3, &v2));
- glUniform3f(location, v0, v1, v2);
+ glUniform3f(location, v0, v1, v2);
-TRACE_END(glUniform3f_);
+ TRACE_END(glUniform3f_);
}
void glUniform3fv_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform3fv_);
+ TRACE_START(glUniform3fv_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1369,21 +1531,22 @@
Dart_TypedData_Type value_typeddata_type;
intptr_t value_typeddata_length;
if (!Dart_IsNull(value_obj)) {
- HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type, &value_data, &value_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type,
+ &value_data, &value_typeddata_length));
}
const GLfloat* value = static_cast<const GLfloat*>(value_data);
- glUniform3fv(location, count, value);
+ glUniform3fv(location, count, value);
if (!Dart_IsNull(value_obj)) {
HANDLE(Dart_TypedDataReleaseData(value_obj));
}
-
-TRACE_END(glUniform3fv_);
+
+ TRACE_END(glUniform3fv_);
}
void glUniform3i_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform3i_);
+ TRACE_START(glUniform3i_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1396,13 +1559,13 @@
int64_t v2;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 3, &v2));
- glUniform3i(location, v0, v1, v2);
+ glUniform3i(location, v0, v1, v2);
-TRACE_END(glUniform3i_);
+ TRACE_END(glUniform3i_);
}
void glUniform3iv_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform3iv_);
+ TRACE_START(glUniform3iv_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1414,21 +1577,22 @@
Dart_TypedData_Type value_typeddata_type;
intptr_t value_typeddata_length;
if (!Dart_IsNull(value_obj)) {
- HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type, &value_data, &value_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type,
+ &value_data, &value_typeddata_length));
}
const GLint* value = static_cast<const GLint*>(value_data);
- glUniform3iv(location, count, value);
+ glUniform3iv(location, count, value);
if (!Dart_IsNull(value_obj)) {
HANDLE(Dart_TypedDataReleaseData(value_obj));
}
-
-TRACE_END(glUniform3iv_);
+
+ TRACE_END(glUniform3iv_);
}
void glUniform4f_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform4f_);
+ TRACE_START(glUniform4f_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1444,13 +1608,13 @@
double v3;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 4, &v3));
- glUniform4f(location, v0, v1, v2, v3);
+ glUniform4f(location, v0, v1, v2, v3);
-TRACE_END(glUniform4f_);
+ TRACE_END(glUniform4f_);
}
void glUniform4fv_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform4fv_);
+ TRACE_START(glUniform4fv_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1462,21 +1626,22 @@
Dart_TypedData_Type value_typeddata_type;
intptr_t value_typeddata_length;
if (!Dart_IsNull(value_obj)) {
- HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type, &value_data, &value_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type,
+ &value_data, &value_typeddata_length));
}
const GLfloat* value = static_cast<const GLfloat*>(value_data);
- glUniform4fv(location, count, value);
+ glUniform4fv(location, count, value);
if (!Dart_IsNull(value_obj)) {
HANDLE(Dart_TypedDataReleaseData(value_obj));
}
-
-TRACE_END(glUniform4fv_);
+
+ TRACE_END(glUniform4fv_);
}
void glUniform4i_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform4i_);
+ TRACE_START(glUniform4i_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1492,13 +1657,13 @@
int64_t v3;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 4, &v3));
- glUniform4i(location, v0, v1, v2, v3);
+ glUniform4i(location, v0, v1, v2, v3);
-TRACE_END(glUniform4i_);
+ TRACE_END(glUniform4i_);
}
void glUniform4iv_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniform4iv_);
+ TRACE_START(glUniform4iv_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1510,21 +1675,22 @@
Dart_TypedData_Type value_typeddata_type;
intptr_t value_typeddata_length;
if (!Dart_IsNull(value_obj)) {
- HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type, &value_data, &value_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type,
+ &value_data, &value_typeddata_length));
}
const GLint* value = static_cast<const GLint*>(value_data);
- glUniform4iv(location, count, value);
+ glUniform4iv(location, count, value);
if (!Dart_IsNull(value_obj)) {
HANDLE(Dart_TypedDataReleaseData(value_obj));
}
-
-TRACE_END(glUniform4iv_);
+
+ TRACE_END(glUniform4iv_);
}
void glUniformMatrix2fv_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniformMatrix2fv_);
+ TRACE_START(glUniformMatrix2fv_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1539,21 +1705,22 @@
Dart_TypedData_Type value_typeddata_type;
intptr_t value_typeddata_length;
if (!Dart_IsNull(value_obj)) {
- HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type, &value_data, &value_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type,
+ &value_data, &value_typeddata_length));
}
const GLfloat* value = static_cast<const GLfloat*>(value_data);
- glUniformMatrix2fv(location, count, transpose, value);
+ glUniformMatrix2fv(location, count, transpose, value);
if (!Dart_IsNull(value_obj)) {
HANDLE(Dart_TypedDataReleaseData(value_obj));
}
-
-TRACE_END(glUniformMatrix2fv_);
+
+ TRACE_END(glUniformMatrix2fv_);
}
void glUniformMatrix3fv_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniformMatrix3fv_);
+ TRACE_START(glUniformMatrix3fv_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1568,21 +1735,22 @@
Dart_TypedData_Type value_typeddata_type;
intptr_t value_typeddata_length;
if (!Dart_IsNull(value_obj)) {
- HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type, &value_data, &value_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type,
+ &value_data, &value_typeddata_length));
}
const GLfloat* value = static_cast<const GLfloat*>(value_data);
- glUniformMatrix3fv(location, count, transpose, value);
+ glUniformMatrix3fv(location, count, transpose, value);
if (!Dart_IsNull(value_obj)) {
HANDLE(Dart_TypedDataReleaseData(value_obj));
}
-
-TRACE_END(glUniformMatrix3fv_);
+
+ TRACE_END(glUniformMatrix3fv_);
}
void glUniformMatrix4fv_native(Dart_NativeArguments arguments) {
-TRACE_START(glUniformMatrix4fv_);
+ TRACE_START(glUniformMatrix4fv_);
int64_t location;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &location));
@@ -1597,54 +1765,55 @@
Dart_TypedData_Type value_typeddata_type;
intptr_t value_typeddata_length;
if (!Dart_IsNull(value_obj)) {
- HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type, &value_data, &value_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(value_obj, &value_typeddata_type,
+ &value_data, &value_typeddata_length));
}
const GLfloat* value = static_cast<const GLfloat*>(value_data);
- glUniformMatrix4fv(location, count, transpose, value);
+ glUniformMatrix4fv(location, count, transpose, value);
if (!Dart_IsNull(value_obj)) {
HANDLE(Dart_TypedDataReleaseData(value_obj));
}
-
-TRACE_END(glUniformMatrix4fv_);
+
+ TRACE_END(glUniformMatrix4fv_);
}
void glUseProgram_native(Dart_NativeArguments arguments) {
-TRACE_START(glUseProgram_);
+ TRACE_START(glUseProgram_);
int64_t program;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &program));
- glUseProgram(program);
+ glUseProgram(program);
-TRACE_END(glUseProgram_);
+ TRACE_END(glUseProgram_);
}
void glValidateProgram_native(Dart_NativeArguments arguments) {
-TRACE_START(glValidateProgram_);
+ TRACE_START(glValidateProgram_);
int64_t program;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &program));
- glValidateProgram(program);
+ glValidateProgram(program);
-TRACE_END(glValidateProgram_);
+ TRACE_END(glValidateProgram_);
}
void glVertexAttrib1f_native(Dart_NativeArguments arguments) {
-TRACE_START(glVertexAttrib1f_);
+ TRACE_START(glVertexAttrib1f_);
int64_t index;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &index));
double x;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 1, &x));
- glVertexAttrib1f(index, x);
+ glVertexAttrib1f(index, x);
-TRACE_END(glVertexAttrib1f_);
+ TRACE_END(glVertexAttrib1f_);
}
void glVertexAttrib1fv_native(Dart_NativeArguments arguments) {
-TRACE_START(glVertexAttrib1fv_);
+ TRACE_START(glVertexAttrib1fv_);
int64_t index;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &index));
@@ -1653,21 +1822,22 @@
Dart_TypedData_Type v_typeddata_type;
intptr_t v_typeddata_length;
if (!Dart_IsNull(v_obj)) {
- HANDLE(Dart_TypedDataAcquireData(v_obj, &v_typeddata_type, &v_data, &v_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(v_obj, &v_typeddata_type, &v_data,
+ &v_typeddata_length));
}
const GLfloat* v = static_cast<const GLfloat*>(v_data);
- glVertexAttrib1fv(index, v);
+ glVertexAttrib1fv(index, v);
if (!Dart_IsNull(v_obj)) {
HANDLE(Dart_TypedDataReleaseData(v_obj));
}
-
-TRACE_END(glVertexAttrib1fv_);
+
+ TRACE_END(glVertexAttrib1fv_);
}
void glVertexAttrib2f_native(Dart_NativeArguments arguments) {
-TRACE_START(glVertexAttrib2f_);
+ TRACE_START(glVertexAttrib2f_);
int64_t index;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &index));
@@ -1677,13 +1847,13 @@
double y;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 2, &y));
- glVertexAttrib2f(index, x, y);
+ glVertexAttrib2f(index, x, y);
-TRACE_END(glVertexAttrib2f_);
+ TRACE_END(glVertexAttrib2f_);
}
void glVertexAttrib2fv_native(Dart_NativeArguments arguments) {
-TRACE_START(glVertexAttrib2fv_);
+ TRACE_START(glVertexAttrib2fv_);
int64_t index;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &index));
@@ -1692,21 +1862,22 @@
Dart_TypedData_Type v_typeddata_type;
intptr_t v_typeddata_length;
if (!Dart_IsNull(v_obj)) {
- HANDLE(Dart_TypedDataAcquireData(v_obj, &v_typeddata_type, &v_data, &v_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(v_obj, &v_typeddata_type, &v_data,
+ &v_typeddata_length));
}
const GLfloat* v = static_cast<const GLfloat*>(v_data);
- glVertexAttrib2fv(index, v);
+ glVertexAttrib2fv(index, v);
if (!Dart_IsNull(v_obj)) {
HANDLE(Dart_TypedDataReleaseData(v_obj));
}
-
-TRACE_END(glVertexAttrib2fv_);
+
+ TRACE_END(glVertexAttrib2fv_);
}
void glVertexAttrib3f_native(Dart_NativeArguments arguments) {
-TRACE_START(glVertexAttrib3f_);
+ TRACE_START(glVertexAttrib3f_);
int64_t index;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &index));
@@ -1719,13 +1890,13 @@
double z;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 3, &z));
- glVertexAttrib3f(index, x, y, z);
+ glVertexAttrib3f(index, x, y, z);
-TRACE_END(glVertexAttrib3f_);
+ TRACE_END(glVertexAttrib3f_);
}
void glVertexAttrib3fv_native(Dart_NativeArguments arguments) {
-TRACE_START(glVertexAttrib3fv_);
+ TRACE_START(glVertexAttrib3fv_);
int64_t index;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &index));
@@ -1734,21 +1905,22 @@
Dart_TypedData_Type v_typeddata_type;
intptr_t v_typeddata_length;
if (!Dart_IsNull(v_obj)) {
- HANDLE(Dart_TypedDataAcquireData(v_obj, &v_typeddata_type, &v_data, &v_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(v_obj, &v_typeddata_type, &v_data,
+ &v_typeddata_length));
}
const GLfloat* v = static_cast<const GLfloat*>(v_data);
- glVertexAttrib3fv(index, v);
+ glVertexAttrib3fv(index, v);
if (!Dart_IsNull(v_obj)) {
HANDLE(Dart_TypedDataReleaseData(v_obj));
}
-
-TRACE_END(glVertexAttrib3fv_);
+
+ TRACE_END(glVertexAttrib3fv_);
}
void glVertexAttrib4f_native(Dart_NativeArguments arguments) {
-TRACE_START(glVertexAttrib4f_);
+ TRACE_START(glVertexAttrib4f_);
int64_t index;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &index));
@@ -1764,13 +1936,13 @@
double w;
HANDLE(Dart_GetNativeDoubleArgument(arguments, 4, &w));
- glVertexAttrib4f(index, x, y, z, w);
+ glVertexAttrib4f(index, x, y, z, w);
-TRACE_END(glVertexAttrib4f_);
+ TRACE_END(glVertexAttrib4f_);
}
void glVertexAttrib4fv_native(Dart_NativeArguments arguments) {
-TRACE_START(glVertexAttrib4fv_);
+ TRACE_START(glVertexAttrib4fv_);
int64_t index;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &index));
@@ -1779,21 +1951,22 @@
Dart_TypedData_Type v_typeddata_type;
intptr_t v_typeddata_length;
if (!Dart_IsNull(v_obj)) {
- HANDLE(Dart_TypedDataAcquireData(v_obj, &v_typeddata_type, &v_data, &v_typeddata_length));
+ HANDLE(Dart_TypedDataAcquireData(v_obj, &v_typeddata_type, &v_data,
+ &v_typeddata_length));
}
const GLfloat* v = static_cast<const GLfloat*>(v_data);
- glVertexAttrib4fv(index, v);
+ glVertexAttrib4fv(index, v);
if (!Dart_IsNull(v_obj)) {
HANDLE(Dart_TypedDataReleaseData(v_obj));
}
-
-TRACE_END(glVertexAttrib4fv_);
+
+ TRACE_END(glVertexAttrib4fv_);
}
void glViewport_native(Dart_NativeArguments arguments) {
-TRACE_START(glViewport_);
+ TRACE_START(glViewport_);
int64_t x;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &x));
@@ -1806,8 +1979,170 @@
int64_t height;
HANDLE(Dart_GetNativeIntegerArgument(arguments, 3, &height));
- glViewport(x, y, width, height);
+ glViewport(x, y, width, height);
-TRACE_END(glViewport_);
+ TRACE_END(glViewport_);
}
+void glProgramBinaryOES_native(Dart_NativeArguments arguments) {
+ TRACE_START(glProgramBinaryOES_);
+ int64_t program;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &program));
+
+ int64_t binaryFormat;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &binaryFormat));
+
+ Dart_Handle binary_obj = HANDLE(Dart_GetNativeArgument(arguments, 2));
+ void* binary_data = nullptr;
+ Dart_TypedData_Type binary_typeddata_type;
+ intptr_t binary_typeddata_length;
+ if (!Dart_IsNull(binary_obj)) {
+ HANDLE(Dart_TypedDataAcquireData(binary_obj, &binary_typeddata_type,
+ &binary_data, &binary_typeddata_length));
+ }
+ const void* binary = static_cast<const void*>(binary_data);
+
+ int64_t length;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 3, &length));
+
+ glProgramBinaryOES(program, binaryFormat, binary, length);
+
+ if (!Dart_IsNull(binary_obj)) {
+ HANDLE(Dart_TypedDataReleaseData(binary_obj));
+ }
+
+ TRACE_END(glProgramBinaryOES_);
+}
+
+void glUnmapBufferOES_native(Dart_NativeArguments arguments) {
+ TRACE_START(glUnmapBufferOES_);
+ int64_t target;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
+
+ GLboolean ret = glUnmapBufferOES(target);
+ Dart_SetBooleanReturnValue(arguments, ret);
+ TRACE_END(glUnmapBufferOES_);
+}
+
+void glBindVertexArrayOES_native(Dart_NativeArguments arguments) {
+ TRACE_START(glBindVertexArrayOES_);
+ int64_t array;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &array));
+
+ glBindVertexArrayOES(array);
+
+ TRACE_END(glBindVertexArrayOES_);
+}
+
+void glDeleteVertexArraysOES_native(Dart_NativeArguments arguments) {
+ TRACE_START(glDeleteVertexArraysOES_);
+ Dart_Handle values_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
+ GLuint* values = NULL;
+ intptr_t n = 0;
+ HANDLE(Dart_ListLength(values_obj, &n));
+ values = static_cast<GLuint*>(malloc(sizeof(GLuint) * n));
+ for (int i = 0; i < n; i++) {
+ Dart_Handle i_obj = HANDLE(Dart_ListGetAt(values_obj, i));
+ HANDLE(Dart_IntegerToUInt(i_obj, &values[i]));
+ }
+ glDeleteVertexArraysOES(n, values);
+ free(values);
+
+ TRACE_END(glDeleteVertexArraysOES_);
+}
+
+void glGenVertexArraysOES_native(Dart_NativeArguments arguments) {
+ TRACE_START(glGenVertexArraysOES_);
+ int64_t n;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &n));
+
+ GLuint* values = static_cast<GLuint*>(malloc(sizeof(GLuint) * n));
+ glGenVertexArraysOES(n, values);
+ Dart_Handle values_obj = Dart_NewList(n);
+ for (int i = 0; i < n; i++) {
+ Dart_Handle i_obj = HANDLE(Dart_NewInteger(values[i]));
+ HANDLE(Dart_ListSetAt(values_obj, i, i_obj));
+ }
+ Dart_SetReturnValue(arguments, values_obj);
+ free(values);
+
+ TRACE_END(glGenVertexArraysOES_);
+}
+
+void glIsVertexArrayOES_native(Dart_NativeArguments arguments) {
+ TRACE_START(glIsVertexArrayOES_);
+ int64_t array;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &array));
+
+ GLboolean ret = glIsVertexArrayOES(array);
+ Dart_SetBooleanReturnValue(arguments, ret);
+ TRACE_END(glIsVertexArrayOES_);
+}
+
+void glRenderbufferStorageMultisampleEXT_native(
+ Dart_NativeArguments arguments) {
+ TRACE_START(glRenderbufferStorageMultisampleEXT_);
+ int64_t target;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
+
+ int64_t samples;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &samples));
+
+ int64_t internalformat;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 2, &internalformat));
+
+ int64_t width;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 3, &width));
+
+ int64_t height;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 4, &height));
+
+ glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width,
+ height);
+
+ TRACE_END(glRenderbufferStorageMultisampleEXT_);
+}
+
+void glFramebufferTexture2DMultisampleEXT_native(
+ Dart_NativeArguments arguments) {
+ TRACE_START(glFramebufferTexture2DMultisampleEXT_);
+ int64_t target;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &target));
+
+ int64_t attachment;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 1, &attachment));
+
+ int64_t textarget;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 2, &textarget));
+
+ int64_t texture;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 3, &texture));
+
+ int64_t level;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 4, &level));
+
+ int64_t samples;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 5, &samples));
+
+ glFramebufferTexture2DMultisampleEXT(target, attachment, textarget, texture,
+ level, samples);
+
+ TRACE_END(glFramebufferTexture2DMultisampleEXT_);
+}
+
+void glGetGraphicsResetStatusEXT_native(Dart_NativeArguments arguments) {
+ TRACE_START(glGetGraphicsResetStatusEXT_);
+ GLenum ret = glGetGraphicsResetStatusEXT();
+ Dart_SetIntegerReturnValue(arguments, ret);
+ TRACE_END(glGetGraphicsResetStatusEXT_);
+}
+
+void glTexDirectInvalidateVIV_native(Dart_NativeArguments arguments) {
+ TRACE_START(glTexDirectInvalidateVIV_);
+ int64_t Target;
+ HANDLE(Dart_GetNativeIntegerArgument(arguments, 0, &Target));
+
+ glTexDirectInvalidateVIV(Target);
+
+ TRACE_END(glTexDirectInvalidateVIV_);
+}
diff --git a/lib/src/generated/gl_bindings.h b/lib/src/generated/gl_bindings.h
index f236b62..0537777 100644
--- a/lib/src/generated/gl_bindings.h
+++ b/lib/src/generated/gl_bindings.h
@@ -39,8 +39,12 @@
void glCreateProgram_native(Dart_NativeArguments arguments);
void glCreateShader_native(Dart_NativeArguments arguments);
void glCullFace_native(Dart_NativeArguments arguments);
+void glDeleteBuffers_native(Dart_NativeArguments arguments);
+void glDeleteFramebuffers_native(Dart_NativeArguments arguments);
void glDeleteProgram_native(Dart_NativeArguments arguments);
+void glDeleteRenderbuffers_native(Dart_NativeArguments arguments);
void glDeleteShader_native(Dart_NativeArguments arguments);
+void glDeleteTextures_native(Dart_NativeArguments arguments);
void glDepthFunc_native(Dart_NativeArguments arguments);
void glDepthMask_native(Dart_NativeArguments arguments);
void glDepthRangef_native(Dart_NativeArguments arguments);
@@ -56,7 +60,11 @@
void glFramebufferRenderbuffer_native(Dart_NativeArguments arguments);
void glFramebufferTexture2D_native(Dart_NativeArguments arguments);
void glFrontFace_native(Dart_NativeArguments arguments);
+void glGenBuffers_native(Dart_NativeArguments arguments);
void glGenerateMipmap_native(Dart_NativeArguments arguments);
+void glGenFramebuffers_native(Dart_NativeArguments arguments);
+void glGenRenderbuffers_native(Dart_NativeArguments arguments);
+void glGenTextures_native(Dart_NativeArguments arguments);
void glGetAttribLocation_native(Dart_NativeArguments arguments);
void glGetError_native(Dart_NativeArguments arguments);
void glGetString_native(Dart_NativeArguments arguments);
@@ -117,5 +125,16 @@
void glVertexAttrib4f_native(Dart_NativeArguments arguments);
void glVertexAttrib4fv_native(Dart_NativeArguments arguments);
void glViewport_native(Dart_NativeArguments arguments);
+void glProgramBinaryOES_native(Dart_NativeArguments arguments);
+void glUnmapBufferOES_native(Dart_NativeArguments arguments);
+void glBindVertexArrayOES_native(Dart_NativeArguments arguments);
+void glDeleteVertexArraysOES_native(Dart_NativeArguments arguments);
+void glGenVertexArraysOES_native(Dart_NativeArguments arguments);
+void glIsVertexArrayOES_native(Dart_NativeArguments arguments);
+void glRenderbufferStorageMultisampleEXT_native(Dart_NativeArguments arguments);
+void glFramebufferTexture2DMultisampleEXT_native(
+ Dart_NativeArguments arguments);
+void glGetGraphicsResetStatusEXT_native(Dart_NativeArguments arguments);
+void glTexDirectInvalidateVIV_native(Dart_NativeArguments arguments);
-#endif // DART_GL_LIB_SRC_GENERATED_GENERATED_BINDINGS_H_
+#endif // DART_GL_LIB_SRC_GENERATED_GENERATED_BINDINGS_H_
diff --git a/lib/src/generated/gl_constants.dart b/lib/src/generated/gl_constants.dart
index 8816927..1c1a708 100644
--- a/lib/src/generated/gl_constants.dart
+++ b/lib/src/generated/gl_constants.dart
@@ -307,4 +307,715 @@
const int GL_FRAMEBUFFER_BINDING = 0x8CA6;
const int GL_RENDERBUFFER_BINDING = 0x8CA7;
const int GL_MAX_RENDERBUFFER_SIZE = 0x84E8;
-const int GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506;
\ No newline at end of file
+const int GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506;
+const int GL_KHR_debug = 1;
+const int GL_SAMPLER = 0x82E6;
+const int GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR = 0x8242;
+const int GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR = 0x8243;
+const int GL_DEBUG_CALLBACK_FUNCTION_KHR = 0x8244;
+const int GL_DEBUG_CALLBACK_USER_PARAM_KHR = 0x8245;
+const int GL_DEBUG_SOURCE_API_KHR = 0x8246;
+const int GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR = 0x8247;
+const int GL_DEBUG_SOURCE_SHADER_COMPILER_KHR = 0x8248;
+const int GL_DEBUG_SOURCE_THIRD_PARTY_KHR = 0x8249;
+const int GL_DEBUG_SOURCE_APPLICATION_KHR = 0x824A;
+const int GL_DEBUG_SOURCE_OTHER_KHR = 0x824B;
+const int GL_DEBUG_TYPE_ERROR_KHR = 0x824C;
+const int GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR = 0x824D;
+const int GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR = 0x824E;
+const int GL_DEBUG_TYPE_PORTABILITY_KHR = 0x824F;
+const int GL_DEBUG_TYPE_PERFORMANCE_KHR = 0x8250;
+const int GL_DEBUG_TYPE_OTHER_KHR = 0x8251;
+const int GL_DEBUG_TYPE_MARKER_KHR = 0x8268;
+const int GL_DEBUG_TYPE_PUSH_GROUP_KHR = 0x8269;
+const int GL_DEBUG_TYPE_POP_GROUP_KHR = 0x826A;
+const int GL_DEBUG_SEVERITY_NOTIFICATION_KHR = 0x826B;
+const int GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR = 0x826C;
+const int GL_DEBUG_GROUP_STACK_DEPTH_KHR = 0x826D;
+const int GL_BUFFER_KHR = 0x82E0;
+const int GL_SHADER_KHR = 0x82E1;
+const int GL_PROGRAM_KHR = 0x82E2;
+const int GL_VERTEX_ARRAY_KHR = 0x8074;
+const int GL_QUERY_KHR = 0x82E3;
+const int GL_SAMPLER_KHR = 0x82E6;
+const int GL_MAX_LABEL_LENGTH_KHR = 0x82E8;
+const int GL_MAX_DEBUG_MESSAGE_LENGTH_KHR = 0x9143;
+const int GL_MAX_DEBUG_LOGGED_MESSAGES_KHR = 0x9144;
+const int GL_DEBUG_LOGGED_MESSAGES_KHR = 0x9145;
+const int GL_DEBUG_SEVERITY_HIGH_KHR = 0x9146;
+const int GL_DEBUG_SEVERITY_MEDIUM_KHR = 0x9147;
+const int GL_DEBUG_SEVERITY_LOW_KHR = 0x9148;
+const int GL_DEBUG_OUTPUT_KHR = 0x92E0;
+const int GL_CONTEXT_FLAG_DEBUG_BIT_KHR = 0x00000002;
+const int GL_STACK_OVERFLOW_KHR = 0x0503;
+const int GL_STACK_UNDERFLOW_KHR = 0x0504;
+const int GL_KHR_texture_compression_astc_hdr = 1;
+const int GL_COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0;
+const int GL_COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1;
+const int GL_COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2;
+const int GL_COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3;
+const int GL_COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4;
+const int GL_COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5;
+const int GL_COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6;
+const int GL_COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7;
+const int GL_COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8;
+const int GL_COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9;
+const int GL_COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA;
+const int GL_COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB;
+const int GL_COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC;
+const int GL_COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD;
+const int GL_KHR_texture_compression_astc_ldr = 1;
+const int GL_OES_EGL_image = 1;
+const int GL_OES_EGL_image_external = 1;
+const int GL_TEXTURE_EXTERNAL_OES = 0x8D65;
+const int GL_TEXTURE_BINDING_EXTERNAL_OES = 0x8D67;
+const int GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES = 0x8D68;
+const int GL_SAMPLER_EXTERNAL_OES = 0x8D66;
+const int GL_OES_compressed_ETC1_RGB8_texture = 1;
+const int GL_ETC1_RGB8_OES = 0x8D64;
+const int GL_OES_compressed_paletted_texture = 1;
+const int GL_PALETTE4_RGB8_OES = 0x8B90;
+const int GL_PALETTE4_RGBA8_OES = 0x8B91;
+const int GL_PALETTE4_R5_G6_B5_OES = 0x8B92;
+const int GL_PALETTE4_RGBA4_OES = 0x8B93;
+const int GL_PALETTE4_RGB5_A1_OES = 0x8B94;
+const int GL_PALETTE8_RGB8_OES = 0x8B95;
+const int GL_PALETTE8_RGBA8_OES = 0x8B96;
+const int GL_PALETTE8_R5_G6_B5_OES = 0x8B97;
+const int GL_PALETTE8_RGBA4_OES = 0x8B98;
+const int GL_PALETTE8_RGB5_A1_OES = 0x8B99;
+const int GL_OES_depth24 = 1;
+const int GL_DEPTH_COMPONENT24_OES = 0x81A6;
+const int GL_OES_depth32 = 1;
+const int GL_DEPTH_COMPONENT32_OES = 0x81A7;
+const int GL_OES_depth_texture = 1;
+const int GL_OES_element_index_uint = 1;
+const int GL_OES_fbo_render_mipmap = 1;
+const int GL_OES_fragment_precision_high = 1;
+const int GL_OES_get_program_binary = 1;
+const int GL_PROGRAM_BINARY_LENGTH_OES = 0x8741;
+const int GL_NUM_PROGRAM_BINARY_FORMATS_OES = 0x87FE;
+const int GL_PROGRAM_BINARY_FORMATS_OES = 0x87FF;
+const int GL_OES_mapbuffer = 1;
+const int GL_WRITE_ONLY_OES = 0x88B9;
+const int GL_BUFFER_ACCESS_OES = 0x88BB;
+const int GL_BUFFER_MAPPED_OES = 0x88BC;
+const int GL_BUFFER_MAP_POINTER_OES = 0x88BD;
+const int GL_OES_packed_depth_stencil = 1;
+const int GL_DEPTH_STENCIL_OES = 0x84F9;
+const int GL_UNSIGNED_INT_24_8_OES = 0x84FA;
+const int GL_DEPTH24_STENCIL8_OES = 0x88F0;
+const int GL_OES_required_internalformat = 1;
+const int GL_ALPHA8_OES = 0x803C;
+const int GL_DEPTH_COMPONENT16_OES = 0x81A5;
+const int GL_LUMINANCE4_ALPHA4_OES = 0x8043;
+const int GL_LUMINANCE8_ALPHA8_OES = 0x8045;
+const int GL_LUMINANCE8_OES = 0x8040;
+const int GL_RGBA4_OES = 0x8056;
+const int GL_RGB5_A1_OES = 0x8057;
+const int GL_RGB565_OES = 0x8D62;
+const int GL_RGB8_OES = 0x8051;
+const int GL_RGBA8_OES = 0x8058;
+const int GL_RGB10_EXT = 0x8052;
+const int GL_RGB10_A2_EXT = 0x8059;
+const int GL_OES_rgb8_rgba8 = 1;
+const int GL_OES_standard_derivatives = 1;
+const int GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
+const int GL_OES_stencil1 = 1;
+const int GL_STENCIL_INDEX1_OES = 0x8D46;
+const int GL_OES_stencil4 = 1;
+const int GL_STENCIL_INDEX4_OES = 0x8D47;
+const int GL_OES_surfaceless_context = 1;
+const int GL_FRAMEBUFFER_UNDEFINED_OES = 0x8219;
+const int GL_OES_texture_3D = 1;
+const int GL_TEXTURE_WRAP_R_OES = 0x8072;
+const int GL_TEXTURE_3D_OES = 0x806F;
+const int GL_TEXTURE_BINDING_3D_OES = 0x806A;
+const int GL_MAX_3D_TEXTURE_SIZE_OES = 0x8073;
+const int GL_SAMPLER_3D_OES = 0x8B5F;
+const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES = 0x8CD4;
+const int GL_OES_texture_compression_astc = 1;
+const int GL_COMPRESSED_RGBA_ASTC_3x3x3_OES = 0x93C0;
+const int GL_COMPRESSED_RGBA_ASTC_4x3x3_OES = 0x93C1;
+const int GL_COMPRESSED_RGBA_ASTC_4x4x3_OES = 0x93C2;
+const int GL_COMPRESSED_RGBA_ASTC_4x4x4_OES = 0x93C3;
+const int GL_COMPRESSED_RGBA_ASTC_5x4x4_OES = 0x93C4;
+const int GL_COMPRESSED_RGBA_ASTC_5x5x4_OES = 0x93C5;
+const int GL_COMPRESSED_RGBA_ASTC_5x5x5_OES = 0x93C6;
+const int GL_COMPRESSED_RGBA_ASTC_6x5x5_OES = 0x93C7;
+const int GL_COMPRESSED_RGBA_ASTC_6x6x5_OES = 0x93C8;
+const int GL_COMPRESSED_RGBA_ASTC_6x6x6_OES = 0x93C9;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES = 0x93E0;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES = 0x93E1;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES = 0x93E2;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES = 0x93E3;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES = 0x93E4;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES = 0x93E5;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES = 0x93E6;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES = 0x93E7;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES = 0x93E8;
+const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES = 0x93E9;
+const int GL_OES_texture_float = 1;
+const int GL_OES_texture_float_linear = 1;
+const int GL_OES_texture_half_float = 1;
+const int GL_HALF_FLOAT_OES = 0x8D61;
+const int GL_OES_texture_half_float_linear = 1;
+const int GL_OES_texture_npot = 1;
+const int GL_OES_vertex_array_object = 1;
+const int GL_VERTEX_ARRAY_BINDING_OES = 0x85B5;
+const int GL_OES_vertex_half_float = 1;
+const int GL_OES_vertex_type_10_10_10_2 = 1;
+const int GL_UNSIGNED_INT_10_10_10_2_OES = 0x8DF6;
+const int GL_INT_10_10_10_2_OES = 0x8DF7;
+const int GL_AMD_compressed_3DC_texture = 1;
+const int GL_3DC_X_AMD = 0x87F9;
+const int GL_3DC_XY_AMD = 0x87FA;
+const int GL_AMD_compressed_ATC_texture = 1;
+const int GL_ATC_RGB_AMD = 0x8C92;
+const int GL_ATC_RGBA_EXPLICIT_ALPHA_AMD = 0x8C93;
+const int GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD = 0x87EE;
+const int GL_AMD_performance_monitor = 1;
+const int GL_COUNTER_TYPE_AMD = 0x8BC0;
+const int GL_COUNTER_RANGE_AMD = 0x8BC1;
+const int GL_UNSIGNED_INT64_AMD = 0x8BC2;
+const int GL_PERCENTAGE_AMD = 0x8BC3;
+const int GL_PERFMON_RESULT_AVAILABLE_AMD = 0x8BC4;
+const int GL_PERFMON_RESULT_SIZE_AMD = 0x8BC5;
+const int GL_PERFMON_RESULT_AMD = 0x8BC6;
+const int GL_AMD_program_binary_Z400 = 1;
+const int GL_Z400_BINARY_AMD = 0x8740;
+const int GL_ANGLE_depth_texture = 1;
+const int GL_ANGLE_framebuffer_blit = 1;
+const int GL_READ_FRAMEBUFFER_ANGLE = 0x8CA8;
+const int GL_DRAW_FRAMEBUFFER_ANGLE = 0x8CA9;
+const int GL_DRAW_FRAMEBUFFER_BINDING_ANGLE = 0x8CA6;
+const int GL_READ_FRAMEBUFFER_BINDING_ANGLE = 0x8CAA;
+const int GL_ANGLE_framebuffer_multisample = 1;
+const int GL_RENDERBUFFER_SAMPLES_ANGLE = 0x8CAB;
+const int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE = 0x8D56;
+const int GL_MAX_SAMPLES_ANGLE = 0x8D57;
+const int GL_ANGLE_instanced_arrays = 1;
+const int GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
+const int GL_ANGLE_pack_reverse_row_order = 1;
+const int GL_PACK_REVERSE_ROW_ORDER_ANGLE = 0x93A4;
+const int GL_ANGLE_program_binary = 1;
+const int GL_PROGRAM_BINARY_ANGLE = 0x93A6;
+const int GL_ANGLE_texture_compression_dxt3 = 1;
+const int GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE = 0x83F2;
+const int GL_ANGLE_texture_compression_dxt5 = 1;
+const int GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE = 0x83F3;
+const int GL_ANGLE_texture_usage = 1;
+const int GL_TEXTURE_USAGE_ANGLE = 0x93A2;
+const int GL_FRAMEBUFFER_ATTACHMENT_ANGLE = 0x93A3;
+const int GL_ANGLE_translated_shader_source = 1;
+const int GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE = 0x93A0;
+const int GL_APPLE_copy_texture_levels = 1;
+const int GL_APPLE_framebuffer_multisample = 1;
+const int GL_RENDERBUFFER_SAMPLES_APPLE = 0x8CAB;
+const int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE = 0x8D56;
+const int GL_MAX_SAMPLES_APPLE = 0x8D57;
+const int GL_READ_FRAMEBUFFER_APPLE = 0x8CA8;
+const int GL_DRAW_FRAMEBUFFER_APPLE = 0x8CA9;
+const int GL_DRAW_FRAMEBUFFER_BINDING_APPLE = 0x8CA6;
+const int GL_READ_FRAMEBUFFER_BINDING_APPLE = 0x8CAA;
+const int GL_APPLE_rgb_422 = 1;
+const int GL_RGB_422_APPLE = 0x8A1F;
+const int GL_UNSIGNED_SHORT_8_8_APPLE = 0x85BA;
+const int GL_UNSIGNED_SHORT_8_8_REV_APPLE = 0x85BB;
+const int GL_RGB_RAW_422_APPLE = 0x8A51;
+const int GL_APPLE_sync = 1;
+const int GL_SYNC_OBJECT_APPLE = 0x8A53;
+const int GL_MAX_SERVER_WAIT_TIMEOUT_APPLE = 0x9111;
+const int GL_OBJECT_TYPE_APPLE = 0x9112;
+const int GL_SYNC_CONDITION_APPLE = 0x9113;
+const int GL_SYNC_STATUS_APPLE = 0x9114;
+const int GL_SYNC_FLAGS_APPLE = 0x9115;
+const int GL_SYNC_FENCE_APPLE = 0x9116;
+const int GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE = 0x9117;
+const int GL_UNSIGNALED_APPLE = 0x9118;
+const int GL_SIGNALED_APPLE = 0x9119;
+const int GL_ALREADY_SIGNALED_APPLE = 0x911A;
+const int GL_TIMEOUT_EXPIRED_APPLE = 0x911B;
+const int GL_CONDITION_SATISFIED_APPLE = 0x911C;
+const int GL_WAIT_FAILED_APPLE = 0x911D;
+const int GL_SYNC_FLUSH_COMMANDS_BIT_APPLE = 0x00000001;
+const int GL_TIMEOUT_IGNORED_APPLE = 0xFFFFFFFFFFFFFFFF;
+const int GL_APPLE_texture_format_BGRA8888 = 1;
+const int GL_BGRA_EXT = 0x80E1;
+const int GL_BGRA8_EXT = 0x93A1;
+const int GL_APPLE_texture_max_level = 1;
+const int GL_TEXTURE_MAX_LEVEL_APPLE = 0x813D;
+const int GL_ARM_mali_program_binary = 1;
+const int GL_MALI_PROGRAM_BINARY_ARM = 0x8F61;
+const int GL_ARM_mali_shader_binary = 1;
+const int GL_MALI_SHADER_BINARY_ARM = 0x8F60;
+const int GL_ARM_rgba8 = 1;
+const int GL_DMP_shader_binary = 1;
+const int GL_SHADER_BINARY_DMP = 0x9250;
+const int GL_EXT_blend_minmax = 1;
+const int GL_MIN_EXT = 0x8007;
+const int GL_MAX_EXT = 0x8008;
+const int GL_EXT_color_buffer_half_float = 1;
+const int GL_RGBA16F_EXT = 0x881A;
+const int GL_RGB16F_EXT = 0x881B;
+const int GL_RG16F_EXT = 0x822F;
+const int GL_R16F_EXT = 0x822D;
+const int GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211;
+const int GL_UNSIGNED_NORMALIZED_EXT = 0x8C17;
+const int GL_EXT_debug_label = 1;
+const int GL_PROGRAM_PIPELINE_OBJECT_EXT = 0x8A4F;
+const int GL_PROGRAM_OBJECT_EXT = 0x8B40;
+const int GL_SHADER_OBJECT_EXT = 0x8B48;
+const int GL_BUFFER_OBJECT_EXT = 0x9151;
+const int GL_QUERY_OBJECT_EXT = 0x9153;
+const int GL_VERTEX_ARRAY_OBJECT_EXT = 0x9154;
+const int GL_TRANSFORM_FEEDBACK = 0x8E22;
+const int GL_EXT_debug_marker = 1;
+const int GL_EXT_discard_framebuffer = 1;
+const int GL_COLOR_EXT = 0x1800;
+const int GL_DEPTH_EXT = 0x1801;
+const int GL_STENCIL_EXT = 0x1802;
+const int GL_EXT_disjoint_timer_query = 1;
+const int GL_QUERY_COUNTER_BITS_EXT = 0x8864;
+const int GL_CURRENT_QUERY_EXT = 0x8865;
+const int GL_QUERY_RESULT_EXT = 0x8866;
+const int GL_QUERY_RESULT_AVAILABLE_EXT = 0x8867;
+const int GL_TIME_ELAPSED_EXT = 0x88BF;
+const int GL_TIMESTAMP_EXT = 0x8E28;
+const int GL_GPU_DISJOINT_EXT = 0x8FBB;
+const int GL_EXT_draw_buffers = 1;
+const int GL_MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF;
+const int GL_MAX_DRAW_BUFFERS_EXT = 0x8824;
+const int GL_DRAW_BUFFER0_EXT = 0x8825;
+const int GL_DRAW_BUFFER1_EXT = 0x8826;
+const int GL_DRAW_BUFFER2_EXT = 0x8827;
+const int GL_DRAW_BUFFER3_EXT = 0x8828;
+const int GL_DRAW_BUFFER4_EXT = 0x8829;
+const int GL_DRAW_BUFFER5_EXT = 0x882A;
+const int GL_DRAW_BUFFER6_EXT = 0x882B;
+const int GL_DRAW_BUFFER7_EXT = 0x882C;
+const int GL_DRAW_BUFFER8_EXT = 0x882D;
+const int GL_DRAW_BUFFER9_EXT = 0x882E;
+const int GL_DRAW_BUFFER10_EXT = 0x882F;
+const int GL_DRAW_BUFFER11_EXT = 0x8830;
+const int GL_DRAW_BUFFER12_EXT = 0x8831;
+const int GL_DRAW_BUFFER13_EXT = 0x8832;
+const int GL_DRAW_BUFFER14_EXT = 0x8833;
+const int GL_DRAW_BUFFER15_EXT = 0x8834;
+const int GL_COLOR_ATTACHMENT0_EXT = 0x8CE0;
+const int GL_COLOR_ATTACHMENT1_EXT = 0x8CE1;
+const int GL_COLOR_ATTACHMENT2_EXT = 0x8CE2;
+const int GL_COLOR_ATTACHMENT3_EXT = 0x8CE3;
+const int GL_COLOR_ATTACHMENT4_EXT = 0x8CE4;
+const int GL_COLOR_ATTACHMENT5_EXT = 0x8CE5;
+const int GL_COLOR_ATTACHMENT6_EXT = 0x8CE6;
+const int GL_COLOR_ATTACHMENT7_EXT = 0x8CE7;
+const int GL_COLOR_ATTACHMENT8_EXT = 0x8CE8;
+const int GL_COLOR_ATTACHMENT9_EXT = 0x8CE9;
+const int GL_COLOR_ATTACHMENT10_EXT = 0x8CEA;
+const int GL_COLOR_ATTACHMENT11_EXT = 0x8CEB;
+const int GL_COLOR_ATTACHMENT12_EXT = 0x8CEC;
+const int GL_COLOR_ATTACHMENT13_EXT = 0x8CED;
+const int GL_COLOR_ATTACHMENT14_EXT = 0x8CEE;
+const int GL_COLOR_ATTACHMENT15_EXT = 0x8CEF;
+const int GL_EXT_draw_instanced = 1;
+const int GL_EXT_instanced_arrays = 1;
+const int GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT = 0x88FE;
+const int GL_EXT_map_buffer_range = 1;
+const int GL_MAP_READ_BIT_EXT = 0x0001;
+const int GL_MAP_WRITE_BIT_EXT = 0x0002;
+const int GL_MAP_INVALIDATE_RANGE_BIT_EXT = 0x0004;
+const int GL_MAP_INVALIDATE_BUFFER_BIT_EXT = 0x0008;
+const int GL_MAP_FLUSH_EXPLICIT_BIT_EXT = 0x0010;
+const int GL_MAP_UNSYNCHRONIZED_BIT_EXT = 0x0020;
+const int GL_EXT_multi_draw_arrays = 1;
+const int GL_EXT_multisampled_render_to_texture = 1;
+const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT = 0x8D6C;
+const int GL_RENDERBUFFER_SAMPLES_EXT = 0x8CAB;
+const int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT = 0x8D56;
+const int GL_MAX_SAMPLES_EXT = 0x8D57;
+const int GL_EXT_multiview_draw_buffers = 1;
+const int GL_COLOR_ATTACHMENT_EXT = 0x90F0;
+const int GL_MULTIVIEW_EXT = 0x90F1;
+const int GL_DRAW_BUFFER_EXT = 0x0C01;
+const int GL_READ_BUFFER_EXT = 0x0C02;
+const int GL_MAX_MULTIVIEW_BUFFERS_EXT = 0x90F2;
+const int GL_EXT_occlusion_query_boolean = 1;
+const int GL_ANY_SAMPLES_PASSED_EXT = 0x8C2F;
+const int GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT = 0x8D6A;
+const int GL_EXT_pvrtc_sRGB = 1;
+const int GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT = 0x8A54;
+const int GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT = 0x8A55;
+const int GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT = 0x8A56;
+const int GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT = 0x8A57;
+const int GL_EXT_read_format_bgra = 1;
+const int GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT = 0x8365;
+const int GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT = 0x8366;
+const int GL_EXT_robustness = 1;
+const int GL_GUILTY_CONTEXT_RESET_EXT = 0x8253;
+const int GL_INNOCENT_CONTEXT_RESET_EXT = 0x8254;
+const int GL_UNKNOWN_CONTEXT_RESET_EXT = 0x8255;
+const int GL_CONTEXT_ROBUST_ACCESS_EXT = 0x90F3;
+const int GL_RESET_NOTIFICATION_STRATEGY_EXT = 0x8256;
+const int GL_LOSE_CONTEXT_ON_RESET_EXT = 0x8252;
+const int GL_NO_RESET_NOTIFICATION_EXT = 0x8261;
+const int GL_EXT_sRGB = 1;
+const int GL_SRGB_EXT = 0x8C40;
+const int GL_SRGB_ALPHA_EXT = 0x8C42;
+const int GL_SRGB8_ALPHA8_EXT = 0x8C43;
+const int GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210;
+const int GL_EXT_sRGB_write_control = 1;
+const int GL_FRAMEBUFFER_SRGB_EXT = 0x8DB9;
+const int GL_EXT_separate_shader_objects = 1;
+const int GL_ACTIVE_PROGRAM_EXT = 0x8259;
+const int GL_VERTEX_SHADER_BIT_EXT = 0x00000001;
+const int GL_FRAGMENT_SHADER_BIT_EXT = 0x00000002;
+const int GL_ALL_SHADER_BITS_EXT = 0xFFFFFFFF;
+const int GL_PROGRAM_SEPARABLE_EXT = 0x8258;
+const int GL_PROGRAM_PIPELINE_BINDING_EXT = 0x825A;
+const int GL_EXT_shader_framebuffer_fetch = 1;
+const int GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT = 0x8A52;
+const int GL_EXT_shader_integer_mix = 1;
+const int GL_EXT_shader_texture_lod = 1;
+const int GL_EXT_shadow_samplers = 1;
+const int GL_TEXTURE_COMPARE_MODE_EXT = 0x884C;
+const int GL_TEXTURE_COMPARE_FUNC_EXT = 0x884D;
+const int GL_COMPARE_REF_TO_TEXTURE_EXT = 0x884E;
+const int GL_SAMPLER_2D_SHADOW_EXT = 0x8B62;
+const int GL_EXT_texture_compression_dxt1 = 1;
+const int GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
+const int GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
+const int GL_EXT_texture_compression_s3tc = 1;
+const int GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
+const int GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
+const int GL_EXT_texture_filter_anisotropic = 1;
+const int GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
+const int GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
+const int GL_EXT_texture_format_BGRA8888 = 1;
+const int GL_EXT_texture_rg = 1;
+const int GL_RED_EXT = 0x1903;
+const int GL_RG_EXT = 0x8227;
+const int GL_R8_EXT = 0x8229;
+const int GL_RG8_EXT = 0x822B;
+const int GL_EXT_texture_sRGB_decode = 1;
+const int GL_TEXTURE_SRGB_DECODE_EXT = 0x8A48;
+const int GL_DECODE_EXT = 0x8A49;
+const int GL_SKIP_DECODE_EXT = 0x8A4A;
+const int GL_EXT_texture_storage = 1;
+const int GL_TEXTURE_IMMUTABLE_FORMAT_EXT = 0x912F;
+const int GL_ALPHA8_EXT = 0x803C;
+const int GL_LUMINANCE8_EXT = 0x8040;
+const int GL_LUMINANCE8_ALPHA8_EXT = 0x8045;
+const int GL_RGBA32F_EXT = 0x8814;
+const int GL_RGB32F_EXT = 0x8815;
+const int GL_ALPHA32F_EXT = 0x8816;
+const int GL_LUMINANCE32F_EXT = 0x8818;
+const int GL_LUMINANCE_ALPHA32F_EXT = 0x8819;
+const int GL_ALPHA16F_EXT = 0x881C;
+const int GL_LUMINANCE16F_EXT = 0x881E;
+const int GL_LUMINANCE_ALPHA16F_EXT = 0x881F;
+const int GL_R32F_EXT = 0x822E;
+const int GL_RG32F_EXT = 0x8230;
+const int GL_EXT_texture_type_2_10_10_10_REV = 1;
+const int GL_UNSIGNED_INT_2_10_10_10_REV_EXT = 0x8368;
+const int GL_EXT_unpack_subimage = 1;
+const int GL_UNPACK_ROW_LENGTH_EXT = 0x0CF2;
+const int GL_UNPACK_SKIP_ROWS_EXT = 0x0CF3;
+const int GL_UNPACK_SKIP_PIXELS_EXT = 0x0CF4;
+const int GL_FJ_shader_binary_GCCSO = 1;
+const int GL_GCCSO_SHADER_BINARY_FJ = 0x9260;
+const int GL_IMG_multisampled_render_to_texture = 1;
+const int GL_RENDERBUFFER_SAMPLES_IMG = 0x9133;
+const int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG = 0x9134;
+const int GL_MAX_SAMPLES_IMG = 0x9135;
+const int GL_TEXTURE_SAMPLES_IMG = 0x9136;
+const int GL_IMG_program_binary = 1;
+const int GL_SGX_PROGRAM_BINARY_IMG = 0x9130;
+const int GL_IMG_read_format = 1;
+const int GL_BGRA_IMG = 0x80E1;
+const int GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG = 0x8365;
+const int GL_IMG_shader_binary = 1;
+const int GL_SGX_BINARY_IMG = 0x8C0A;
+const int GL_IMG_texture_compression_pvrtc = 1;
+const int GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
+const int GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;
+const int GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
+const int GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
+const int GL_IMG_texture_compression_pvrtc2 = 1;
+const int GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG = 0x9137;
+const int GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG = 0x9138;
+const int GL_INTEL_performance_query = 1;
+const int GL_PERFQUERY_SINGLE_CONTEXT_INTEL = 0x00000000;
+const int GL_PERFQUERY_GLOBAL_CONTEXT_INTEL = 0x00000001;
+const int GL_PERFQUERY_WAIT_INTEL = 0x83FB;
+const int GL_PERFQUERY_FLUSH_INTEL = 0x83FA;
+const int GL_PERFQUERY_DONOT_FLUSH_INTEL = 0x83F9;
+const int GL_PERFQUERY_COUNTER_EVENT_INTEL = 0x94F0;
+const int GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL = 0x94F1;
+const int GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL = 0x94F2;
+const int GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL = 0x94F3;
+const int GL_PERFQUERY_COUNTER_RAW_INTEL = 0x94F4;
+const int GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL = 0x94F5;
+const int GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL = 0x94F8;
+const int GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL = 0x94F9;
+const int GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL = 0x94FA;
+const int GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL = 0x94FB;
+const int GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL = 0x94FC;
+const int GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL = 0x94FD;
+const int GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL = 0x94FE;
+const int GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL = 0x94FF;
+const int GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL = 0x9500;
+const int GL_NV_blend_equation_advanced = 1;
+const int GL_BLEND_OVERLAP_NV = 0x9281;
+const int GL_BLEND_PREMULTIPLIED_SRC_NV = 0x9280;
+const int GL_BLUE_NV = 0x1905;
+const int GL_COLORBURN_NV = 0x929A;
+const int GL_COLORDODGE_NV = 0x9299;
+const int GL_CONJOINT_NV = 0x9284;
+const int GL_CONTRAST_NV = 0x92A1;
+const int GL_DARKEN_NV = 0x9297;
+const int GL_DIFFERENCE_NV = 0x929E;
+const int GL_DISJOINT_NV = 0x9283;
+const int GL_DST_ATOP_NV = 0x928F;
+const int GL_DST_IN_NV = 0x928B;
+const int GL_DST_NV = 0x9287;
+const int GL_DST_OUT_NV = 0x928D;
+const int GL_DST_OVER_NV = 0x9289;
+const int GL_EXCLUSION_NV = 0x92A0;
+const int GL_GREEN_NV = 0x1904;
+const int GL_HARDLIGHT_NV = 0x929B;
+const int GL_HARDMIX_NV = 0x92A9;
+const int GL_HSL_COLOR_NV = 0x92AF;
+const int GL_HSL_HUE_NV = 0x92AD;
+const int GL_HSL_LUMINOSITY_NV = 0x92B0;
+const int GL_HSL_SATURATION_NV = 0x92AE;
+const int GL_INVERT_OVG_NV = 0x92B4;
+const int GL_INVERT_RGB_NV = 0x92A3;
+const int GL_LIGHTEN_NV = 0x9298;
+const int GL_LINEARBURN_NV = 0x92A5;
+const int GL_LINEARDODGE_NV = 0x92A4;
+const int GL_LINEARLIGHT_NV = 0x92A7;
+const int GL_MINUS_CLAMPED_NV = 0x92B3;
+const int GL_MINUS_NV = 0x929F;
+const int GL_MULTIPLY_NV = 0x9294;
+const int GL_OVERLAY_NV = 0x9296;
+const int GL_PINLIGHT_NV = 0x92A8;
+const int GL_PLUS_CLAMPED_ALPHA_NV = 0x92B2;
+const int GL_PLUS_CLAMPED_NV = 0x92B1;
+const int GL_PLUS_DARKER_NV = 0x9292;
+const int GL_PLUS_NV = 0x9291;
+const int GL_RED_NV = 0x1903;
+const int GL_SCREEN_NV = 0x9295;
+const int GL_SOFTLIGHT_NV = 0x929C;
+const int GL_SRC_ATOP_NV = 0x928E;
+const int GL_SRC_IN_NV = 0x928A;
+const int GL_SRC_NV = 0x9286;
+const int GL_SRC_OUT_NV = 0x928C;
+const int GL_SRC_OVER_NV = 0x9288;
+const int GL_UNCORRELATED_NV = 0x9282;
+const int GL_VIVIDLIGHT_NV = 0x92A6;
+const int GL_XOR_NV = 0x1506;
+const int GL_NV_blend_equation_advanced_coherent = 1;
+const int GL_BLEND_ADVANCED_COHERENT_NV = 0x9285;
+const int GL_NV_copy_buffer = 1;
+const int GL_COPY_READ_BUFFER_NV = 0x8F36;
+const int GL_COPY_WRITE_BUFFER_NV = 0x8F37;
+const int GL_NV_coverage_sample = 1;
+const int GL_COVERAGE_COMPONENT_NV = 0x8ED0;
+const int GL_COVERAGE_COMPONENT4_NV = 0x8ED1;
+const int GL_COVERAGE_ATTACHMENT_NV = 0x8ED2;
+const int GL_COVERAGE_BUFFERS_NV = 0x8ED3;
+const int GL_COVERAGE_SAMPLES_NV = 0x8ED4;
+const int GL_COVERAGE_ALL_FRAGMENTS_NV = 0x8ED5;
+const int GL_COVERAGE_EDGE_FRAGMENTS_NV = 0x8ED6;
+const int GL_COVERAGE_AUTOMATIC_NV = 0x8ED7;
+const int GL_COVERAGE_BUFFER_BIT_NV = 0x00008000;
+const int GL_NV_depth_nonlinear = 1;
+const int GL_DEPTH_COMPONENT16_NONLINEAR_NV = 0x8E2C;
+const int GL_NV_draw_buffers = 1;
+const int GL_MAX_DRAW_BUFFERS_NV = 0x8824;
+const int GL_DRAW_BUFFER0_NV = 0x8825;
+const int GL_DRAW_BUFFER1_NV = 0x8826;
+const int GL_DRAW_BUFFER2_NV = 0x8827;
+const int GL_DRAW_BUFFER3_NV = 0x8828;
+const int GL_DRAW_BUFFER4_NV = 0x8829;
+const int GL_DRAW_BUFFER5_NV = 0x882A;
+const int GL_DRAW_BUFFER6_NV = 0x882B;
+const int GL_DRAW_BUFFER7_NV = 0x882C;
+const int GL_DRAW_BUFFER8_NV = 0x882D;
+const int GL_DRAW_BUFFER9_NV = 0x882E;
+const int GL_DRAW_BUFFER10_NV = 0x882F;
+const int GL_DRAW_BUFFER11_NV = 0x8830;
+const int GL_DRAW_BUFFER12_NV = 0x8831;
+const int GL_DRAW_BUFFER13_NV = 0x8832;
+const int GL_DRAW_BUFFER14_NV = 0x8833;
+const int GL_DRAW_BUFFER15_NV = 0x8834;
+const int GL_COLOR_ATTACHMENT0_NV = 0x8CE0;
+const int GL_COLOR_ATTACHMENT1_NV = 0x8CE1;
+const int GL_COLOR_ATTACHMENT2_NV = 0x8CE2;
+const int GL_COLOR_ATTACHMENT3_NV = 0x8CE3;
+const int GL_COLOR_ATTACHMENT4_NV = 0x8CE4;
+const int GL_COLOR_ATTACHMENT5_NV = 0x8CE5;
+const int GL_COLOR_ATTACHMENT6_NV = 0x8CE6;
+const int GL_COLOR_ATTACHMENT7_NV = 0x8CE7;
+const int GL_COLOR_ATTACHMENT8_NV = 0x8CE8;
+const int GL_COLOR_ATTACHMENT9_NV = 0x8CE9;
+const int GL_COLOR_ATTACHMENT10_NV = 0x8CEA;
+const int GL_COLOR_ATTACHMENT11_NV = 0x8CEB;
+const int GL_COLOR_ATTACHMENT12_NV = 0x8CEC;
+const int GL_COLOR_ATTACHMENT13_NV = 0x8CED;
+const int GL_COLOR_ATTACHMENT14_NV = 0x8CEE;
+const int GL_COLOR_ATTACHMENT15_NV = 0x8CEF;
+const int GL_NV_draw_instanced = 1;
+const int GL_NV_explicit_attrib_location = 1;
+const int GL_NV_fbo_color_attachments = 1;
+const int GL_MAX_COLOR_ATTACHMENTS_NV = 0x8CDF;
+const int GL_NV_fence = 1;
+const int GL_ALL_COMPLETED_NV = 0x84F2;
+const int GL_FENCE_STATUS_NV = 0x84F3;
+const int GL_FENCE_CONDITION_NV = 0x84F4;
+const int GL_NV_framebuffer_blit = 1;
+const int GL_READ_FRAMEBUFFER_NV = 0x8CA8;
+const int GL_DRAW_FRAMEBUFFER_NV = 0x8CA9;
+const int GL_DRAW_FRAMEBUFFER_BINDING_NV = 0x8CA6;
+const int GL_READ_FRAMEBUFFER_BINDING_NV = 0x8CAA;
+const int GL_NV_framebuffer_multisample = 1;
+const int GL_RENDERBUFFER_SAMPLES_NV = 0x8CAB;
+const int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV = 0x8D56;
+const int GL_MAX_SAMPLES_NV = 0x8D57;
+const int GL_NV_generate_mipmap_sRGB = 1;
+const int GL_NV_instanced_arrays = 1;
+const int GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV = 0x88FE;
+const int GL_NV_non_square_matrices = 1;
+const int GL_FLOAT_MAT2x3_NV = 0x8B65;
+const int GL_FLOAT_MAT2x4_NV = 0x8B66;
+const int GL_FLOAT_MAT3x2_NV = 0x8B67;
+const int GL_FLOAT_MAT3x4_NV = 0x8B68;
+const int GL_FLOAT_MAT4x2_NV = 0x8B69;
+const int GL_FLOAT_MAT4x3_NV = 0x8B6A;
+const int GL_NV_read_buffer = 1;
+const int GL_READ_BUFFER_NV = 0x0C02;
+const int GL_NV_read_buffer_front = 1;
+const int GL_NV_read_depth = 1;
+const int GL_NV_read_depth_stencil = 1;
+const int GL_NV_read_stencil = 1;
+const int GL_NV_sRGB_formats = 1;
+const int GL_SLUMINANCE_NV = 0x8C46;
+const int GL_SLUMINANCE_ALPHA_NV = 0x8C44;
+const int GL_SRGB8_NV = 0x8C41;
+const int GL_SLUMINANCE8_NV = 0x8C47;
+const int GL_SLUMINANCE8_ALPHA8_NV = 0x8C45;
+const int GL_COMPRESSED_SRGB_S3TC_DXT1_NV = 0x8C4C;
+const int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV = 0x8C4D;
+const int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV = 0x8C4E;
+const int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV = 0x8C4F;
+const int GL_ETC1_SRGB8_NV = 0x88EE;
+const int GL_NV_shadow_samplers_array = 1;
+const int GL_SAMPLER_2D_ARRAY_SHADOW_NV = 0x8DC4;
+const int GL_NV_shadow_samplers_cube = 1;
+const int GL_SAMPLER_CUBE_SHADOW_NV = 0x8DC5;
+const int GL_NV_texture_border_clamp = 1;
+const int GL_TEXTURE_BORDER_COLOR_NV = 0x1004;
+const int GL_CLAMP_TO_BORDER_NV = 0x812D;
+const int GL_NV_texture_compression_s3tc_update = 1;
+const int GL_NV_texture_npot_2D_mipmap = 1;
+const int GL_QCOM_alpha_test = 1;
+const int GL_ALPHA_TEST_QCOM = 0x0BC0;
+const int GL_ALPHA_TEST_FUNC_QCOM = 0x0BC1;
+const int GL_ALPHA_TEST_REF_QCOM = 0x0BC2;
+const int GL_QCOM_binning_control = 1;
+const int GL_BINNING_CONTROL_HINT_QCOM = 0x8FB0;
+const int GL_CPU_OPTIMIZED_QCOM = 0x8FB1;
+const int GL_GPU_OPTIMIZED_QCOM = 0x8FB2;
+const int GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM = 0x8FB3;
+const int GL_QCOM_driver_control = 1;
+const int GL_QCOM_extended_get = 1;
+const int GL_TEXTURE_WIDTH_QCOM = 0x8BD2;
+const int GL_TEXTURE_HEIGHT_QCOM = 0x8BD3;
+const int GL_TEXTURE_DEPTH_QCOM = 0x8BD4;
+const int GL_TEXTURE_INTERNAL_FORMAT_QCOM = 0x8BD5;
+const int GL_TEXTURE_FORMAT_QCOM = 0x8BD6;
+const int GL_TEXTURE_TYPE_QCOM = 0x8BD7;
+const int GL_TEXTURE_IMAGE_VALID_QCOM = 0x8BD8;
+const int GL_TEXTURE_NUM_LEVELS_QCOM = 0x8BD9;
+const int GL_TEXTURE_TARGET_QCOM = 0x8BDA;
+const int GL_TEXTURE_OBJECT_VALID_QCOM = 0x8BDB;
+const int GL_STATE_RESTORE = 0x8BDC;
+const int GL_QCOM_extended_get2 = 1;
+const int GL_QCOM_perfmon_global_mode = 1;
+const int GL_PERFMON_GLOBAL_MODE_QCOM = 0x8FA0;
+const int GL_QCOM_tiled_rendering = 1;
+const int GL_COLOR_BUFFER_BIT0_QCOM = 0x00000001;
+const int GL_COLOR_BUFFER_BIT1_QCOM = 0x00000002;
+const int GL_COLOR_BUFFER_BIT2_QCOM = 0x00000004;
+const int GL_COLOR_BUFFER_BIT3_QCOM = 0x00000008;
+const int GL_COLOR_BUFFER_BIT4_QCOM = 0x00000010;
+const int GL_COLOR_BUFFER_BIT5_QCOM = 0x00000020;
+const int GL_COLOR_BUFFER_BIT6_QCOM = 0x00000040;
+const int GL_COLOR_BUFFER_BIT7_QCOM = 0x00000080;
+const int GL_DEPTH_BUFFER_BIT0_QCOM = 0x00000100;
+const int GL_DEPTH_BUFFER_BIT1_QCOM = 0x00000200;
+const int GL_DEPTH_BUFFER_BIT2_QCOM = 0x00000400;
+const int GL_DEPTH_BUFFER_BIT3_QCOM = 0x00000800;
+const int GL_DEPTH_BUFFER_BIT4_QCOM = 0x00001000;
+const int GL_DEPTH_BUFFER_BIT5_QCOM = 0x00002000;
+const int GL_DEPTH_BUFFER_BIT6_QCOM = 0x00004000;
+const int GL_DEPTH_BUFFER_BIT7_QCOM = 0x00008000;
+const int GL_STENCIL_BUFFER_BIT0_QCOM = 0x00010000;
+const int GL_STENCIL_BUFFER_BIT1_QCOM = 0x00020000;
+const int GL_STENCIL_BUFFER_BIT2_QCOM = 0x00040000;
+const int GL_STENCIL_BUFFER_BIT3_QCOM = 0x00080000;
+const int GL_STENCIL_BUFFER_BIT4_QCOM = 0x00100000;
+const int GL_STENCIL_BUFFER_BIT5_QCOM = 0x00200000;
+const int GL_STENCIL_BUFFER_BIT6_QCOM = 0x00400000;
+const int GL_STENCIL_BUFFER_BIT7_QCOM = 0x00800000;
+const int GL_MULTISAMPLE_BUFFER_BIT0_QCOM = 0x01000000;
+const int GL_MULTISAMPLE_BUFFER_BIT1_QCOM = 0x02000000;
+const int GL_MULTISAMPLE_BUFFER_BIT2_QCOM = 0x04000000;
+const int GL_MULTISAMPLE_BUFFER_BIT3_QCOM = 0x08000000;
+const int GL_MULTISAMPLE_BUFFER_BIT4_QCOM = 0x10000000;
+const int GL_MULTISAMPLE_BUFFER_BIT5_QCOM = 0x20000000;
+const int GL_MULTISAMPLE_BUFFER_BIT6_QCOM = 0x40000000;
+const int GL_MULTISAMPLE_BUFFER_BIT7_QCOM = 0x80000000;
+const int GL_QCOM_writeonly_rendering = 1;
+const int GL_WRITEONLY_RENDERING_QCOM = 0x8823;
+const int GL_VIV_shader_binary = 1;
+const int GL_SHADER_BINARY_VIV = 0x8FC4;
+const int GL_VIV_direct_texture = 1;
+const int GL_VIV_YV12 = 0x8FC0;
+const int GL_VIV_NV12 = 0x8FC1;
+const int GL_VIV_YUY2 = 0x8FC2;
+const int GL_VIV_UYVY = 0x8FC3;
+const int GL_VIV_NV21 = 0x8FC4;
+const int GL_VIV_I420 = 0x8FC5;
+const int GL_VIV_timestamp = 1;
+const int GL_TIMESTAMP_VIV0 = 0x8FD0;
+const int GL_TIMESTAMP_VIV1 = 0x8FD1;
+const int GL_TIMESTAMP_VIV2 = 0x8FD2;
+const int GL_TIMESTAMP_VIV3 = 0x8FD3;
+const int GL_TIMESTAMP_VIV4 = 0x8FD4;
+const int GL_TIMESTAMP_VIV5 = 0x8FD5;
+const int GL_TIMESTAMP_VIV6 = 0x8FD6;
+const int GL_TIMESTAMP_VIV7 = 0x8FD7;
+const int GL_VIV_program_binary = 1;
+const int GL_PROGRAM_BINARY_VIV = 0x8FC5;
+const int GL_PROFILE_VIV = 0x8FC7;
+const int GL_VIV_primitive_restart = 1;
+const int GL_PRIMITIVE_RESTART_FIXED_INDEX_VIV = 0x8D69;
+const int GL_VIV_clamp_to_border = 1;
+const int GL_CLAMP_TO_BORDER_VIV = 0x812D;
+const int GL_VIV_developer = 1;
diff --git a/lib/src/generated/gl_native_functions.dart b/lib/src/generated/gl_native_functions.dart
index e2781a8..6b81941 100644
--- a/lib/src/generated/gl_native_functions.dart
+++ b/lib/src/generated/gl_native_functions.dart
@@ -10,34 +10,65 @@
void glActiveTexture(int texture) native "glActiveTexture";
void glAttachShader(int program, int shader) native "glAttachShader";
-void glBindAttribLocation(int program, int index, String name) native "glBindAttribLocation";
+void glBindAttribLocation(int program, int index, String name)
+ native "glBindAttribLocation";
void glBindBuffer(int target, int buffer) native "glBindBuffer";
void glBindFramebuffer(int target, int framebuffer) native "glBindFramebuffer";
-void glBindRenderbuffer(int target, int renderbuffer) native "glBindRenderbuffer";
+void glBindRenderbuffer(int target, int renderbuffer)
+ native "glBindRenderbuffer";
void glBindTexture(int target, int texture) native "glBindTexture";
-void glBlendColor(double red, double green, double blue, double alpha) native "glBlendColor";
+void glBlendColor(double red, double green, double blue, double alpha)
+ native "glBlendColor";
void glBlendEquation(int mode) native "glBlendEquation";
-void glBlendEquationSeparate(int modeRGB, int modeAlpha) native "glBlendEquationSeparate";
+void glBlendEquationSeparate(int modeRGB, int modeAlpha)
+ native "glBlendEquationSeparate";
void glBlendFunc(int sfactor, int dfactor) native "glBlendFunc";
-void glBlendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha) native "glBlendFuncSeparate";
-void glBufferData(int target, int size, TypedData data, int usage) native "glBufferData";
-void glBufferSubData(int target, int offset, int size, TypedData data) native "glBufferSubData";
+void glBlendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha,
+ int dfactorAlpha) native "glBlendFuncSeparate";
+void glBufferData(int target, int size, TypedData data, int usage)
+ native "glBufferData";
+void glBufferSubData(int target, int offset, int size, TypedData data)
+ native "glBufferSubData";
int glCheckFramebufferStatus(int target) native "glCheckFramebufferStatus";
void glClear(int mask) native "glClear";
-void glClearColor(double red, double green, double blue, double alpha) native "glClearColor";
+void glClearColor(double red, double green, double blue, double alpha)
+ native "glClearColor";
void glClearDepthf(double d) native "glClearDepthf";
void glClearStencil(int s) native "glClearStencil";
void glColorMask(int red, int green, int blue, int alpha) native "glColorMask";
void glCompileShader(int shader) native "glCompileShader";
-void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, TypedData data) native "glCompressedTexImage2D";
-void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, TypedData data) native "glCompressedTexSubImage2D";
-void glCopyTexImage2D(int target, int level, int internalformat, int x, int y, int width, int height, int border) native "glCopyTexImage2D";
-void glCopyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) native "glCopyTexSubImage2D";
+void glCompressedTexImage2D(
+ int target,
+ int level,
+ int internalformat,
+ int width,
+ int height,
+ int border,
+ int imageSize,
+ TypedData data) native "glCompressedTexImage2D";
+void glCompressedTexSubImage2D(
+ int target,
+ int level,
+ int xoffset,
+ int yoffset,
+ int width,
+ int height,
+ int format,
+ int imageSize,
+ TypedData data) native "glCompressedTexSubImage2D";
+void glCopyTexImage2D(int target, int level, int internalformat, int x, int y,
+ int width, int height, int border) native "glCopyTexImage2D";
+void glCopyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x,
+ int y, int width, int height) native "glCopyTexSubImage2D";
int glCreateProgram() native "glCreateProgram";
int glCreateShader(int type) native "glCreateShader";
void glCullFace(int mode) native "glCullFace";
+void glDeleteBuffers(List<int> values) native "glDeleteBuffers";
+void glDeleteFramebuffers(List<int> values) native "glDeleteFramebuffers";
void glDeleteProgram(int program) native "glDeleteProgram";
+void glDeleteRenderbuffers(List<int> values) native "glDeleteRenderbuffers";
void glDeleteShader(int shader) native "glDeleteShader";
+void glDeleteTextures(List<int> values) native "glDeleteTextures";
void glDepthFunc(int func) native "glDepthFunc";
void glDepthMask(int flag) native "glDepthMask";
void glDepthRangef(double n, double f) native "glDepthRangef";
@@ -45,19 +76,30 @@
void glDisable(int cap) native "glDisable";
void glDisableVertexAttribArray(int index) native "glDisableVertexAttribArray";
void glDrawArrays(int mode, int first, int count) native "glDrawArrays";
-void glDrawElements(int mode, int count, int type, TypedData indices) native "glDrawElements";
+void glDrawElements(int mode, int count, int type, TypedData indices)
+ native "glDrawElements";
void glEnable(int cap) native "glEnable";
void glEnableVertexAttribArray(int index) native "glEnableVertexAttribArray";
void glFinish() native "glFinish";
void glFlush() native "glFlush";
-void glFramebufferRenderbuffer(int target, int attachment, int renderbuffertarget, int renderbuffer) native "glFramebufferRenderbuffer";
-void glFramebufferTexture2D(int target, int attachment, int textarget, int texture, int level) native "glFramebufferTexture2D";
+void glFramebufferRenderbuffer(
+ int target,
+ int attachment,
+ int renderbuffertarget,
+ int renderbuffer) native "glFramebufferRenderbuffer";
+void glFramebufferTexture2D(int target, int attachment, int textarget,
+ int texture, int level) native "glFramebufferTexture2D";
void glFrontFace(int mode) native "glFrontFace";
+List<int> glGenBuffers(int n) native "glGenBuffers";
void glGenerateMipmap(int target) native "glGenerateMipmap";
+List<int> glGenFramebuffers(int n) native "glGenFramebuffers";
+List<int> glGenRenderbuffers(int n) native "glGenRenderbuffers";
+List<int> glGenTextures(int n) native "glGenTextures";
int glGetAttribLocation(int program, String name) native "glGetAttribLocation";
int glGetError() native "glGetError";
String glGetString(int name) native "glGetString";
-int glGetUniformLocation(int program, String name) native "glGetUniformLocation";
+int glGetUniformLocation(int program, String name)
+ native "glGetUniformLocation";
void glHint(int target, int mode) native "glHint";
bool glIsBuffer(int buffer) native "glIsBuffer";
bool glIsEnabled(int cap) native "glIsEnabled";
@@ -71,46 +113,106 @@
void glPixelStorei(int pname, int param) native "glPixelStorei";
void glPolygonOffset(double factor, double units) native "glPolygonOffset";
void glReleaseShaderCompiler() native "glReleaseShaderCompiler";
-void glRenderbufferStorage(int target, int internalformat, int width, int height) native "glRenderbufferStorage";
+void glRenderbufferStorage(int target, int internalformat, int width,
+ int height) native "glRenderbufferStorage";
void glSampleCoverage(double value, int invert) native "glSampleCoverage";
void glScissor(int x, int y, int width, int height) native "glScissor";
void glStencilFunc(int func, int ref, int mask) native "glStencilFunc";
-void glStencilFuncSeparate(int face, int func, int ref, int mask) native "glStencilFuncSeparate";
+void glStencilFuncSeparate(int face, int func, int ref, int mask)
+ native "glStencilFuncSeparate";
void glStencilMask(int mask) native "glStencilMask";
void glStencilMaskSeparate(int face, int mask) native "glStencilMaskSeparate";
void glStencilOp(int fail, int zfail, int zpass) native "glStencilOp";
-void glStencilOpSeparate(int face, int sfail, int dpfail, int dppass) native "glStencilOpSeparate";
-void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, TypedData pixels) native "glTexImage2D";
-void glTexParameterf(int target, int pname, double param) native "glTexParameterf";
+void glStencilOpSeparate(int face, int sfail, int dpfail, int dppass)
+ native "glStencilOpSeparate";
+void glTexImage2D(
+ int target,
+ int level,
+ int internalformat,
+ int width,
+ int height,
+ int border,
+ int format,
+ int type,
+ TypedData pixels) native "glTexImage2D";
+void glTexParameterf(int target, int pname, double param)
+ native "glTexParameterf";
void glTexParameteri(int target, int pname, int param) native "glTexParameteri";
-void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, TypedData pixels) native "glTexSubImage2D";
+void glTexSubImage2D(
+ int target,
+ int level,
+ int xoffset,
+ int yoffset,
+ int width,
+ int height,
+ int format,
+ int type,
+ TypedData pixels) native "glTexSubImage2D";
void glUniform1f(int location, double v0) native "glUniform1f";
-void glUniform1fv(int location, int count, TypedData value) native "glUniform1fv";
+void glUniform1fv(int location, int count, TypedData value)
+ native "glUniform1fv";
void glUniform1i(int location, int v0) native "glUniform1i";
-void glUniform1iv(int location, int count, TypedData value) native "glUniform1iv";
+void glUniform1iv(int location, int count, TypedData value)
+ native "glUniform1iv";
void glUniform2f(int location, double v0, double v1) native "glUniform2f";
-void glUniform2fv(int location, int count, TypedData value) native "glUniform2fv";
+void glUniform2fv(int location, int count, TypedData value)
+ native "glUniform2fv";
void glUniform2i(int location, int v0, int v1) native "glUniform2i";
-void glUniform2iv(int location, int count, TypedData value) native "glUniform2iv";
-void glUniform3f(int location, double v0, double v1, double v2) native "glUniform3f";
-void glUniform3fv(int location, int count, TypedData value) native "glUniform3fv";
+void glUniform2iv(int location, int count, TypedData value)
+ native "glUniform2iv";
+void glUniform3f(int location, double v0, double v1, double v2)
+ native "glUniform3f";
+void glUniform3fv(int location, int count, TypedData value)
+ native "glUniform3fv";
void glUniform3i(int location, int v0, int v1, int v2) native "glUniform3i";
-void glUniform3iv(int location, int count, TypedData value) native "glUniform3iv";
-void glUniform4f(int location, double v0, double v1, double v2, double v3) native "glUniform4f";
-void glUniform4fv(int location, int count, TypedData value) native "glUniform4fv";
-void glUniform4i(int location, int v0, int v1, int v2, int v3) native "glUniform4i";
-void glUniform4iv(int location, int count, TypedData value) native "glUniform4iv";
-void glUniformMatrix2fv(int location, int count, int transpose, TypedData value) native "glUniformMatrix2fv";
-void glUniformMatrix3fv(int location, int count, int transpose, TypedData value) native "glUniformMatrix3fv";
-void glUniformMatrix4fv(int location, int count, int transpose, TypedData value) native "glUniformMatrix4fv";
+void glUniform3iv(int location, int count, TypedData value)
+ native "glUniform3iv";
+void glUniform4f(int location, double v0, double v1, double v2, double v3)
+ native "glUniform4f";
+void glUniform4fv(int location, int count, TypedData value)
+ native "glUniform4fv";
+void glUniform4i(int location, int v0, int v1, int v2, int v3)
+ native "glUniform4i";
+void glUniform4iv(int location, int count, TypedData value)
+ native "glUniform4iv";
+void glUniformMatrix2fv(int location, int count, int transpose, TypedData value)
+ native "glUniformMatrix2fv";
+void glUniformMatrix3fv(int location, int count, int transpose, TypedData value)
+ native "glUniformMatrix3fv";
+void glUniformMatrix4fv(int location, int count, int transpose, TypedData value)
+ native "glUniformMatrix4fv";
void glUseProgram(int program) native "glUseProgram";
void glValidateProgram(int program) native "glValidateProgram";
void glVertexAttrib1f(int index, double x) native "glVertexAttrib1f";
void glVertexAttrib1fv(int index, TypedData v) native "glVertexAttrib1fv";
void glVertexAttrib2f(int index, double x, double y) native "glVertexAttrib2f";
void glVertexAttrib2fv(int index, TypedData v) native "glVertexAttrib2fv";
-void glVertexAttrib3f(int index, double x, double y, double z) native "glVertexAttrib3f";
+void glVertexAttrib3f(int index, double x, double y, double z)
+ native "glVertexAttrib3f";
void glVertexAttrib3fv(int index, TypedData v) native "glVertexAttrib3fv";
-void glVertexAttrib4f(int index, double x, double y, double z, double w) native "glVertexAttrib4f";
+void glVertexAttrib4f(int index, double x, double y, double z, double w)
+ native "glVertexAttrib4f";
void glVertexAttrib4fv(int index, TypedData v) native "glVertexAttrib4fv";
void glViewport(int x, int y, int width, int height) native "glViewport";
+void glProgramBinaryOES(int program, int binaryFormat, TypedData binary,
+ int length) native "glProgramBinaryOES";
+bool glUnmapBufferOES(int target) native "glUnmapBufferOES";
+void glBindVertexArrayOES(int array) native "glBindVertexArrayOES";
+void glDeleteVertexArraysOES(List<int> values) native "glDeleteVertexArraysOES";
+List<int> glGenVertexArraysOES(int n) native "glGenVertexArraysOES";
+bool glIsVertexArrayOES(int array) native "glIsVertexArrayOES";
+void glRenderbufferStorageMultisampleEXT(
+ int target,
+ int samples,
+ int internalformat,
+ int width,
+ int height) native "glRenderbufferStorageMultisampleEXT";
+void glFramebufferTexture2DMultisampleEXT(
+ int target,
+ int attachment,
+ int textarget,
+ int texture,
+ int level,
+ int samples) native "glFramebufferTexture2DMultisampleEXT";
+int glGetGraphicsResetStatusEXT() native "glGetGraphicsResetStatusEXT";
+void glTexDirectInvalidateVIV(int Target) native "glTexDirectInvalidateVIV";
diff --git a/lib/src/gl_classes.dart b/lib/src/gl_classes.dart
deleted file mode 100644
index 2e4a95d..0000000
--- a/lib/src/gl_classes.dart
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2015, the Dart GL extension authors. All rights reserved.
-// Please see the AUTHORS file for details. Use of this source code is governed
-// by a BSD-style license that can be found in the LICENSE file or at
-// https://developers.google.com/open-source/licenses/bsd
-
-part of gl;
-
-/// Contains data returned by [glGetActiveAttrib] or [glGetActiveUniform]
-/// calls.
-class ActiveInfo {
- /// Returns the size of the attribute variable.
- final int size;
-
- /// Returns the data type of the attribute variable.
- final int type;
-
- /// Returns the [String] containing the name of the attribute variable.
- final String name;
-
- ActiveInfo(this.size, this.type, this.name);
-}
-
-/// Contains data returned by [glGetShaderPrecisionFormat] about the
-/// range and precision for different shader numeric (floating point and
-/// integer) shader variable formats.
-class ShaderPrecisionFormat {
- /// The precision of the format.
- final int precision;
- /// The maximum representable magnitude of the format.
- final int rangeMax;
- /// The minimum representable magnitude of the format.
- final int rangeMin;
- ShaderPrecisionFormat(this.rangeMin, this.rangeMax, this.precision);
-}
diff --git a/lib/src/gl_extension.cc b/lib/src/gl_extension.cc
index b115dd4..fc2bf86 100644
--- a/lib/src/gl_extension.cc
+++ b/lib/src/gl_extension.cc
@@ -7,14 +7,12 @@
#include "dart_api.h"
-#include "gl_extension.h"
-
-#include "manual_bindings.h"
-#include "util.h"
#include "generated/function_list.h"
#include "generated/gl_bindings.h"
-
-Dart_Handle GLLibrary;
+#include "gl_extension.h"
+#include "gl_extension_info.h"
+#include "manual_bindings.h"
+#include "util.h"
DART_EXPORT Dart_Handle gl_extension_Init(Dart_Handle parent_library) {
if (Dart_IsError(parent_library)) {
@@ -27,9 +25,12 @@
return result_code;
}
- GLLibrary = HandleError(Dart_NewPersistentHandle(HandleError(
+ // Look up the GL library and stash it in the info for this isolate.
+ auto gl = HandleError(Dart_NewPersistentHandle(HandleError(
Dart_LookupLibrary(Dart_NewStringFromCString("package:gl/gl.dart")))));
+ GlExtensionInfo::create(gl);
+
return Dart_Null();
}
diff --git a/lib/src/gl_extension.h b/lib/src/gl_extension.h
index 082a05e..834b6fe 100644
--- a/lib/src/gl_extension.h
+++ b/lib/src/gl_extension.h
@@ -3,8 +3,8 @@
// by a BSD-style license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
-#ifndef SRC_GL_EXTENSION_H_
-#define SRC_GL_EXTENSION_H_
+#ifndef DART_GL_LIB_SRC_GL_EXTENSION_H_
+#define DART_GL_LIB_SRC_GL_EXTENSION_H_
#include "dart_api.h"
@@ -15,4 +15,4 @@
DART_EXPORT Dart_Handle gl_extension_Init(Dart_Handle parent_library);
-#endif // SRC_GL_EXTENSION_H_
+#endif // DART_GL_LIB_SRC_GL_EXTENSION_H_
diff --git a/lib/src/gl_extension_info.cc b/lib/src/gl_extension_info.cc
new file mode 100644
index 0000000..c708a4a
--- /dev/null
+++ b/lib/src/gl_extension_info.cc
@@ -0,0 +1,23 @@
+// Copyright (c) 2015, the Dart GL extension authors. All rights reserved.
+// Please see the AUTHORS file for details. Use of this source code is governed
+// by a BSD-style license that can be found in the LICENSE file or at
+// https://developers.google.com/open-source/licenses/bsd
+
+#include "gl_extension_info.h"
+
+// Create GlExtensionInfo for each new library instance.
+void GlExtensionInfo::create(Dart_Handle gl_library) {
+ std::lock_guard<std::mutex> guard(info_for_isolate_mutex_);
+ info_for_isolate_[Dart_CurrentIsolate()] = new GlExtensionInfo(gl_library);
+}
+
+// Query GlExtensionInfo for the current context.
+GlExtensionInfo& GlExtensionInfo::current() {
+ return *info_for_isolate_.at(Dart_CurrentIsolate());
+}
+
+GlExtensionInfo::GlExtensionInfo(Dart_Handle gl_library)
+ : gl_library_(gl_library){};
+
+std::map<Dart_Isolate, GlExtensionInfo*> GlExtensionInfo::info_for_isolate_;
+std::mutex GlExtensionInfo::info_for_isolate_mutex_;
diff --git a/lib/src/gl_extension_info.h b/lib/src/gl_extension_info.h
new file mode 100644
index 0000000..1660529
--- /dev/null
+++ b/lib/src/gl_extension_info.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2015, the Dart GL extension authors. All rights reserved.
+// Please see the AUTHORS file for details. Use of this source code is governed
+// by a BSD-style license that can be found in the LICENSE file or at
+// https://developers.google.com/open-source/licenses/bsd
+
+#ifndef DART_GL_LIB_SRC_GL_EXTENSION_INFO_H_
+#define DART_GL_LIB_SRC_GL_EXTENSION_INFO_H_
+
+#include <map>
+#include <mutex>
+
+#include "dart_api.h"
+
+// Extra data needed for this extension in each isolate.
+class GlExtensionInfo {
+ public:
+ static void create(Dart_Handle gl_library);
+
+ // Returns extra info associated with this library for the Dart isolate
+ // in which it is executing.
+ static GlExtensionInfo& current();
+
+ const Dart_Handle& gl_library() const { return gl_library_; }
+
+ private:
+ GlExtensionInfo(Dart_Handle gl_library);
+
+ // Info unique to this isolate:
+ Dart_Handle gl_library_;
+
+ static std::map<Dart_Isolate, GlExtensionInfo*> info_for_isolate_;
+ static std::mutex info_for_isolate_mutex_;
+};
+
+#endif // DART_GL_LIB_SRC_GL_EXTENSION_INFO_H_
diff --git a/lib/src/instantiate_gl_classes.cc b/lib/src/instantiate_gl_classes.cc
index d67c1ef..b1483eb 100644
--- a/lib/src/instantiate_gl_classes.cc
+++ b/lib/src/instantiate_gl_classes.cc
@@ -8,17 +8,18 @@
#include <stdlib.h>
-#include "GLES2/gl2.h"
+#include <GLES2/gl2.h>
#include "dart_api.h"
#include "gl_extension.h"
+#include "gl_extension_info.h"
+#include "instantiate_gl_classes.h"
#include "util.h"
-#include "instantiate_gl_classes.h"
-
Dart_Handle NewActiveInfo(GLint size, GLenum type, GLchar* name) {
+ auto info = GlExtensionInfo::current();
Dart_Handle ActiveInfo_type = HandleError(Dart_GetType(
- GLLibrary, Dart_NewStringFromCString("ActiveInfo"), 0, NULL));
+ info.gl_library(), Dart_NewStringFromCString("ActiveInfo"), 0, NULL));
const int num_arguments = 3;
Dart_Handle arguments[num_arguments];
@@ -30,8 +31,10 @@
}
Dart_Handle NewShaderPrecisionFormat(GLint* range, GLint precision) {
+ auto info = GlExtensionInfo::current();
Dart_Handle ShaderPrecisionFormat_type = HandleError(Dart_GetType(
- GLLibrary, Dart_NewStringFromCString("ShaderPrecisionFormat"), 0, NULL));
+ info.gl_library(), Dart_NewStringFromCString("ShaderPrecisionFormat"), 0,
+ NULL));
const int num_arguments = 3;
Dart_Handle arguments[num_arguments];
diff --git a/lib/src/instantiate_gl_classes.h b/lib/src/instantiate_gl_classes.h
index 90bad61..f9a78a4 100644
--- a/lib/src/instantiate_gl_classes.h
+++ b/lib/src/instantiate_gl_classes.h
@@ -3,13 +3,13 @@
// by a BSD-style license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
-#ifndef SRC_INSTANTIATE_GL_CLASSES_H_
-#define SRC_INSTANTIATE_GL_CLASSES_H_
+#ifndef DART_GL_LIB_SRC_INSTANTIATE_GL_CLASSES_H_
+#define DART_GL_LIB_SRC_INSTANTIATE_GL_CLASSES_H_
-#include "GLES2/gl2.h"
+#include <GLES2/gl2.h>
#include "dart_api.h"
Dart_Handle NewActiveInfo(GLint size, GLenum type, GLchar* name);
Dart_Handle NewShaderPrecisionFormat(GLint* range, GLint precision);
-#endif // SRC_INSTANTIATE_GL_CLASSES_H_
+#endif // DART_GL_LIB_SRC_INSTANTIATE_GL_CLASSES_H_
diff --git a/lib/src/manual_bindings.cc b/lib/src/manual_bindings.cc
index d8162ad..5c16019 100644
--- a/lib/src/manual_bindings.cc
+++ b/lib/src/manual_bindings.cc
@@ -5,12 +5,11 @@
#include <stdlib.h>
-#include "GLES2/gl2.h"
+#include <GLES2/gl2.h>
#include "dart_api.h"
-#include "manual_bindings.h"
-
#include "instantiate_gl_classes.h"
+#include "manual_bindings.h"
#include "util.h"
// This file contains native extension functions which have to be manually
@@ -18,170 +17,6 @@
// arguments or taking Dart Lists as arguments that need to be parsed to C
// arrays.
-void glDeleteBuffers_native(Dart_NativeArguments arguments) {
- TRACE_START(glDeleteBuffers_);
- Dart_Handle n_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
-
- int64_t n = 0;
- HANDLE(Dart_IntegerToInt64(n_obj, &n));
-
- Dart_Handle buffers_obj = HANDLE(Dart_GetNativeArgument(arguments, 1));
-
- GLuint *buffers = NULL;
- buffers = static_cast<GLuint *>(malloc(sizeof(GLuint) * n));
- for (int i = 0; i < n; i++) {
- Dart_Handle i_obj = HANDLE(Dart_ListGetAt(buffers_obj, i));
-
- HANDLE(Dart_IntegerToUInt(i_obj, &buffers[i]));
- }
- glDeleteBuffers(n, buffers);
- free(buffers);
- TRACE_END(glDeleteBuffers_);
-}
-
-void glDeleteFramebuffers_native(Dart_NativeArguments arguments) {
- TRACE_START(glDeleteFramebuffers_);
- Dart_Handle n_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
-
- int64_t n = 0;
- HANDLE(Dart_IntegerToInt64(n_obj, &n));
-
- Dart_Handle framebuffers_obj = HANDLE(Dart_GetNativeArgument(arguments, 1));
-
- GLuint *framebuffers = NULL;
- framebuffers = static_cast<GLuint *>(malloc(sizeof(GLuint) * n));
- for (int i = 0; i < n; i++) {
- Dart_Handle i_obj = HANDLE(Dart_ListGetAt(framebuffers_obj, i));
-
- HANDLE(Dart_IntegerToUInt(i_obj, &framebuffers[i]));
- }
- glDeleteFramebuffers(n, framebuffers);
- free(framebuffers);
- TRACE_END(glDeleteFramebuffers_);
-}
-
-void glDeleteRenderbuffers_native(Dart_NativeArguments arguments) {
- TRACE_START(glDeleteRenderbuffers_);
- Dart_Handle n_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
-
- int64_t n = 0;
- HANDLE(Dart_IntegerToInt64(n_obj, &n));
-
- Dart_Handle renderbuffers_obj = HANDLE(Dart_GetNativeArgument(arguments, 1));
-
- GLuint *renderbuffers = NULL;
- renderbuffers = static_cast<GLuint *>(malloc(sizeof(GLuint) * n));
- for (int i = 0; i < n; i++) {
- Dart_Handle i_obj = HANDLE(Dart_ListGetAt(renderbuffers_obj, i));
-
- HANDLE(Dart_IntegerToUInt(i_obj, &renderbuffers[i]));
- }
- glDeleteRenderbuffers(n, renderbuffers);
- free(renderbuffers);
- TRACE_END(glDeleteRenderbuffers_);
-}
-
-void glDeleteTextures_native(Dart_NativeArguments arguments) {
- TRACE_START(glDeleteTextures_);
- Dart_Handle n_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
-
- int64_t n = 0;
- HANDLE(Dart_IntegerToInt64(n_obj, &n));
-
- Dart_Handle textures_obj = HANDLE(Dart_GetNativeArgument(arguments, 1));
-
- GLuint *textures = NULL;
- textures = static_cast<GLuint *>(malloc(sizeof(GLuint) * n));
- for (int i = 0; i < n; i++) {
- Dart_Handle i_obj = HANDLE(Dart_ListGetAt(textures_obj, i));
-
- HANDLE(Dart_IntegerToUInt(i_obj, &textures[i]));
- }
- glDeleteTextures(n, textures);
- free(textures);
- TRACE_END(glDeleteTextures_);
-}
-
-void glGenBuffers_native(Dart_NativeArguments arguments) {
- TRACE_START(glGenBuffers_);
- Dart_Handle n_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
-
- int64_t n = 0;
- HANDLE(Dart_IntegerToInt64(n_obj, &n));
-
- GLuint *buffers = static_cast<GLuint *>(malloc(sizeof(GLuint) * n));
- glGenBuffers(n, buffers);
-
- Dart_Handle buffers_obj = Dart_NewList(n);
- for (int i = 0; i < n; i++) {
- Dart_Handle i_obj = HANDLE(Dart_NewInteger(buffers[i]));
- HANDLE(Dart_ListSetAt(buffers_obj, i, i_obj));
- }
- Dart_SetReturnValue(arguments, buffers_obj);
- free(buffers);
- TRACE_END(glGenBuffers_);
-}
-
-void glGenFramebuffers_native(Dart_NativeArguments arguments) {
- TRACE_START(glGenFramebuffers_);
- Dart_Handle n_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
-
- int64_t n = 0;
- HANDLE(Dart_IntegerToInt64(n_obj, &n));
-
- GLuint *framebuffers = static_cast<GLuint *>(malloc(sizeof(GLuint) * n));
- glGenFramebuffers(n, framebuffers);
-
- Dart_Handle framebuffers_obj = Dart_NewList(n);
- for (int i = 0; i < n; i++) {
- Dart_Handle i_obj = HANDLE(Dart_NewInteger(framebuffers[i]));
- HANDLE(Dart_ListSetAt(framebuffers_obj, i, i_obj));
- }
- Dart_SetReturnValue(arguments, framebuffers_obj);
- free(framebuffers);
- TRACE_END(glGenFramebuffers_);
-}
-
-void glGenRenderbuffers_native(Dart_NativeArguments arguments) {
- TRACE_START(glGenRenderbuffers_);
- Dart_Handle n_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
-
- int64_t n = 0;
- HANDLE(Dart_IntegerToInt64(n_obj, &n));
-
- GLuint *renderbuffers = static_cast<GLuint *>(malloc(sizeof(GLuint) * n));
- glGenRenderbuffers(n, renderbuffers);
-
- Dart_Handle renderbuffers_obj = Dart_NewList(n);
- for (int i = 0; i < n; i++) {
- Dart_Handle i_obj = HANDLE(Dart_NewInteger(renderbuffers[i]));
- HANDLE(Dart_ListSetAt(renderbuffers_obj, i, i_obj));
- }
- Dart_SetReturnValue(arguments, renderbuffers_obj);
- free(renderbuffers);
- TRACE_END(glGenRenderbuffers_);
-}
-
-void glGenTextures_native(Dart_NativeArguments arguments) {
- TRACE_START(glGenTextures_);
- Dart_Handle n_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
-
- int64_t n = 0;
- HANDLE(Dart_IntegerToInt64(n_obj, &n));
-
- GLuint *textures = static_cast<GLuint *>(malloc(sizeof(GLuint) * n));
- glGenTextures(n, textures);
-
- Dart_Handle textures_obj = Dart_NewList(n);
- for (int i = 0; i < n; i++) {
- Dart_Handle i_obj = HANDLE(Dart_NewInteger(textures[i]));
- HANDLE(Dart_ListSetAt(textures_obj, i, i_obj));
- }
- Dart_SetReturnValue(arguments, textures_obj);
- free(textures);
- TRACE_END(glGenTextures_);
-}
-
void glGetActiveAttrib_native(Dart_NativeArguments arguments) {
TRACE_START(glGetActiveAttrib_);
Dart_Handle program_obj = HANDLE(Dart_GetNativeArgument(arguments, 0));
diff --git a/lib/src/manual_bindings.dart b/lib/src/manual_bindings.dart
index 9a15772..9a3f989 100644
--- a/lib/src/manual_bindings.dart
+++ b/lib/src/manual_bindings.dart
@@ -5,32 +5,6 @@
part of gl;
-/// Delete a [List] of buffer objects
-void glDeleteBuffers(int n, List<int> buffers) native "glDeleteBuffers";
-
-/// Delete a [List] of framebuffer objects
-void glDeleteFramebuffers(int n, List<int> framebuffers)
- native "glDeleteFramebuffers";
-
-/// Delete a [List] of renderbuffer objects
-void glDeleteRenderbuffers(int n, List<int> renderbuffers)
- native "glDeleteRenderbuffers";
-
-/// Delete a [List] of texture objects
-void glDeleteTextures(int n, List<int> textures) native "glDeleteTextures";
-
-/// Generate a [List] of buffer objects
-List<int> glGenBuffers(int n) native "glGenBuffers";
-
-/// Generate a [List] of framebuffer objects
-List<int> glGenFramebuffers(int n) native "glGenFramebuffers";
-
-/// Generate a [List] of renderbuffer objects
-List<int> glGenRenderbuffers(int n) native "glGenRenderbuffers";
-
-/// Generate a [List] of texture objects
-List<int> glGenTextures(int n) native "glGenTextures";
-
/// Create an [ActiveInfo] object for the given [program] and [index]
ActiveInfo glGetActiveAttrib(int program, int index) native "glGetActiveAttrib";
diff --git a/lib/src/manual_bindings.h b/lib/src/manual_bindings.h
index cac71b7..97471ef 100644
--- a/lib/src/manual_bindings.h
+++ b/lib/src/manual_bindings.h
@@ -3,19 +3,11 @@
// by a BSD-style license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
-#ifndef SRC_MANUAL_BINDINGS_H_
-#define SRC_MANUAL_BINDINGS_H_
+#ifndef DART_GL_LIB_SRC_MANUAL_BINDINGS_H_
+#define DART_GL_LIB_SRC_MANUAL_BINDINGS_H_
#include "dart_api.h"
-void glDeleteBuffers_native(Dart_NativeArguments arguments);
-void glDeleteFramebuffers_native(Dart_NativeArguments arguments);
-void glDeleteRenderbuffers_native(Dart_NativeArguments arguments);
-void glDeleteTextures_native(Dart_NativeArguments arguments);
-void glGenBuffers_native(Dart_NativeArguments arguments);
-void glGenFramebuffers_native(Dart_NativeArguments arguments);
-void glGenRenderbuffers_native(Dart_NativeArguments arguments);
-void glGenTextures_native(Dart_NativeArguments arguments);
void glGetActiveAttrib_native(Dart_NativeArguments arguments);
void glGetActiveUniform_native(Dart_NativeArguments arguments);
void glGetAttachedShaders_native(Dart_NativeArguments arguments);
@@ -45,4 +37,4 @@
void glTexParameteriv_native(Dart_NativeArguments arguments);
void glVertexAttribPointer_native(Dart_NativeArguments arguments);
-#endif // SRC_MANUAL_BINDINGS_H_
+#endif // DART_GL_LIB_SRC_MANUAL_BINDINGS_H_
diff --git a/lib/src/util.cc b/lib/src/util.cc
index f8ac060..1e2c45c 100644
--- a/lib/src/util.cc
+++ b/lib/src/util.cc
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "GLES2/gl2.h"
+#include <GLES2/gl2.h>
#include "dart_api.h"
#include "util.h"
diff --git a/lib/src/util.h b/lib/src/util.h
index a061195..5c43af8 100644
--- a/lib/src/util.h
+++ b/lib/src/util.h
@@ -6,7 +6,7 @@
#ifndef DART_GL_LIB_SRC_UTIL_H_
#define DART_GL_LIB_SRC_UTIL_H_
-#include "GLES2/gl2.h"
+#include <GLES2/gl2.h>
#include "dart_api.h"
Dart_Handle HandleError(Dart_Handle handle);
diff --git a/pubspec.yaml b/pubspec.yaml
index 6b1b73c..0163a9c 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: gl
-version: "1.0.1"
+version: "1.0.2"
description: Dart GLES2 bindings
authors:
- John McDole <[email protected]>
@@ -10,8 +10,9 @@
environment:
sdk: ">=1.0.0 <=2.0.0"
dev_dependencies:
+ args: ^0.13.7
+ ccompile: "^0.2.10"
#glfw: any # for examples in example/dart_example/ - needs to symlink locally
glfw:
path: ../dart-glfw
- ccompile: "^0.2.10"
- path: "^1.3.9"
+ path: ^1.4.1
diff --git a/tools/gl_generator.dart b/tools/gl_generator.dart
index 13411f9..280932e 100644
--- a/tools/gl_generator.dart
+++ b/tools/gl_generator.dart
@@ -5,30 +5,20 @@
import 'package:args/args.dart';
import 'package:path/path.dart' as path;
-String dartPath;
-String glPath;
-String thisPath;
+String outPath;
main(List<String> args) async {
var parser = new ArgParser()
- ..addOption('dart_path',
- help: 'path to directory containing dart_api.h',
- abbr: 'd',
- valueHelp: 'path')
..addOption('gl_path',
help: 'path to directory containing gl2.h',
abbr: 'g',
valueHelp: 'path')
- ..addOption('dart_gl_lib_path',
- help: 'path to directory containing gl_extension.h',
- abbr: 'l',
- valueHelp: 'path',
- hide: true,
- defaultsTo: "")
- ..addOption('strip_path',
- help: 'number of path elements to strip from the head of dart_path, '
- 'gl_path',
- defaultsTo: "0")
+ ..addOption('out',
+ help: 'path to output directory', abbr: 'o', valueHelp: 'path')
+ ..addOption('whitelist',
+ help: 'list of functions that are bound',
+ abbr: 'w',
+ valueHelp: 'whitelist.txt')
..addFlag('help', abbr: 'h', negatable: false);
var results = parser.parse(args);
@@ -42,68 +32,61 @@
exit(exitVal);
}
- int pathStrip;
- try {
- pathStrip = int.parse(results['strip_path']);
- } catch (_) {
- toErr('error parsing strip_path: ${results['strip_path']}');
- }
- if (!results.wasParsed('dart_path')) {
- toErr('error: --dart_path must be provided');
- }
- dartPath = results['dart_path'];
- if (dartPath.isNotEmpty) {
- dartPath = path.joinAll(path.split(dartPath).skip(pathStrip));
- dartPath = '$dartPath${path.separator}';
- }
-
if (!results.wasParsed('gl_path')) {
toErr('error: --gl_path must be provided');
}
- var trueGlPath = results['gl_path'];
- glPath = path.joinAll(path.split(trueGlPath).skip(pathStrip));
- glPath = '$glPath${path.separator}';
+ var glPath = results['gl_path'];
- thisPath = "";
- if (results.wasParsed('dart_gl_lib_path')) {
- thisPath =
- path.joinAll(path.split(results['dart_gl_lib_path']).skip(pathStrip));
- thisPath = '$thisPath${path.separator}';
+ outPath = '.';
+ if (results.wasParsed('out')) {
+ outPath = results['out'];
+ }
+ var generated = await new Directory('$outPath/generated').create();
+ outPath = generated.path;
+
+ var calls = [];
+ var consts = <String, CConst>{};
+ var whitelist;
+ if (results.wasParsed('whitelist')) {
+ var lines = await new File(results['whitelist']).readAsLines();
+ whitelist = lines.map((l) => l.trim()).toList();
}
- await new Directory('generated').create();
-
- var defines = [];
- var calls = [];
-
- var readStream = new File(path.join(trueGlPath, 'gl2.h')).openRead();
- await for (var line
- in readStream.transform(UTF8.decoder).transform(new LineSplitter())) {
- if (line.startsWith('#define GL_')) {
- defines.add(line.substring('#define '.length).trim());
- } else if (line.startsWith('GL_APICALL ')) {
- calls.add(line
- .replaceAll('GL_APICALL ', '')
- .replaceAll('GL_APIENTRY ', '')
- .trim());
+ for (var file in ['gl2.h', 'gl2ext.h']) {
+ var readStream = new File(path.join(glPath, file)).openRead();
+ await for (var line
+ in readStream.transform(UTF8.decoder).transform(new LineSplitter())) {
+ if (line.startsWith('#define GL_')) {
+ var match = CConst.defineReg.firstMatch(line);
+ if (match == null) {
+ print("bad define: $line");
+ continue;
+ }
+ consts.putIfAbsent(match[1], () => new CConst(match[1], match[2]));
+ } else if (line.startsWith('GL_APICALL ')) {
+ calls.add(line
+ .replaceAll('GL_APICALL ', '')
+ .replaceAll('GL_APIENTRY ', '')
+ .trim());
+ }
}
}
var decls = <CDecl>[];
for (var call in calls) {
- decls.add(new CDecl(call));
- }
-
- var consts = <CConst>[];
- for (var def in defines) {
- consts.add(new CConst(def));
+ var decl = new CDecl(call);
+ if (whitelist != null && !whitelist.contains(decl.name)) {
+ print("non-whitelisted decl skipped: $decl");
+ continue;
+ }
+ decls.add(decl);
}
writeFunctionListH(decls);
writeFunctionListC(decls);
writeGlBindingsH(decls);
writeGlBindingsC(decls);
- writeGlConstantsDart(consts);
+ writeGlConstantsDart(consts.values);
writeGlNativeFunctions(decls);
}
@@ -153,6 +136,7 @@
// for glUniform*iv
"const GLint* value": "TypedData",
"const GLint* v": "TypedData",
+ "const GLuint* arrays": "TypedData",
// for glUniform*fv
"const GLfloat* value": "TypedData",
// for glVertexAttrib*fv
@@ -161,13 +145,12 @@
};
writeFunctionListH(List<CDecl> decls) {
- new File('generated/function_list.h').writeAsString('''
+ new File('$outPath/function_list.h').writeAsString('''
$copyright
-
#ifndef DART_GL_LIB_SRC_GENERATED_FUNCTION_LIST_H_
#define DART_GL_LIB_SRC_GENERATED_FUNCTION_LIST_H_
-#include "${dartPath}dart_api.h"
+#include "dart_api.h"
struct FunctionLookup {
const char* name;
@@ -177,12 +160,11 @@
extern const struct FunctionLookup *function_list;
#endif // DART_GL_LIB_SRC_GENERATED_FUNCTION_LIST_H_
-
''');
}
-writeGlConstantsDart(List<CConst> consts) {
- new File('generated/gl_constants.dart').openWrite()
+writeGlConstantsDart(Iterable<CConst> consts) {
+ new File('$outPath/gl_constants.dart').openWrite()
..write(copyright)
..writeln('\n// Generated GL constants.')
..writeAll(consts, '\n')
@@ -190,7 +172,7 @@
}
writeGlNativeFunctions(List<CDecl> decls) {
- var sink = new File('generated/gl_native_functions.dart').openWrite()
+ var sink = new File('$outPath/gl_native_functions.dart').openWrite()
..write(copyright)
..writeln()
..writeln('/// Dart definitions for GL native extension.')
@@ -214,12 +196,12 @@
'${c.needsManualBinding && !c.hasManualBinding ? "// " : ""}'
'{"${c.name}", ${c.nativeName}},';
- new File('generated/function_list.cc').openWrite()
+ new File('$outPath/function_list.cc').openWrite()
..write(copyright)
..write('''
#include <stdlib.h>
-#include "${thisPath}manual_bindings.h"
+#include "../manual_bindings.h"
#include "function_list.h"
#include "gl_bindings.h"
@@ -237,13 +219,13 @@
}
writeGlBindingsH(List<CDecl> decls) {
- var sink = new File('generated/gl_bindings.h').openWrite()
+ var sink = new File('$outPath/gl_bindings.h').openWrite()
..write(copyright)
..write('''
#ifndef DART_GL_LIB_SRC_GENERATED_GENERATED_BINDINGS_H_
#define DART_GL_LIB_SRC_GENERATED_GENERATED_BINDINGS_H_
-#include "${dartPath}dart_api.h"
+#include "dart_api.h"
''');
sink
..writeln()
@@ -260,15 +242,16 @@
}
writeGlBindingsC(List<CDecl> decls) {
- var sink = new File('generated/gl_bindings.cc').openWrite();
+ var sink = new File('$outPath/gl_bindings.cc').openWrite();
sink..write(copyright)..write('''
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include "${glPath}gl2.h"
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
-#include "${thisPath}util.h"
+#include "../util.h"
#include "gl_bindings.h"
// Generated GL function bindings for Dart.
@@ -291,18 +274,33 @@
int i = 0;
var typed = [];
var arguments = [];
- for (var arg in decl.arguments) {
- if (arg.right == "void") continue;
- var dartArg = decl.dartArguments[i];
-
+ if (decl.isGenerator) {
+ var arg = decl.arguments[0];
+ var dartArg = decl.dartArguments[0];
sink.writeln(dartTypeToArg[dartArg.left](arg, i));
arguments.add(arg.right);
if (dartArg.left == 'TypedData') {
typed.add(arg);
}
- i++;
- }
+ } else if (decl.isDeleter) {
+ sink.writeln('Dart_Handle values_obj = '
+ 'HANDLE(Dart_GetNativeArgument(arguments, 0));');
+ } else {
+ for (var arg in decl.arguments) {
+ if (arg.right == "void") continue;
+ var dartArg = decl.dartArguments[i];
+ if (dartTypeToArg[dartArg.left] == null) {
+ throw "dartTypeToArg($dartArg) is null; $decl";
+ }
+ sink.writeln(dartTypeToArg[dartArg.left](arg, i));
+ arguments.add(arg.right);
+ if (dartArg.left == 'TypedData') {
+ typed.add(arg);
+ }
+ i++;
+ }
+ }
// Be sure to capture the return value from the GL function call, if
// necessary.
var ret = "";
@@ -312,10 +310,38 @@
retHandle = dartTypeToRet[decl.dartReturnType]();
}
- // Generate the actual GL function call, using the native arguments
- // extracted above.
- ret = '$ret ${decl.name}(${arguments.join(", ")});';
- sink..writeln(ret)..writeln(retHandle);
+ if (decl.isGenerator) {
+ String count = decl.arguments[0].right;
+ sink..writeln('''
+ GLuint *values = static_cast<GLuint *>(malloc(sizeof(GLuint) * $count));
+ ${decl.name}($count, values);
+ Dart_Handle values_obj = Dart_NewList($count);
+ for (int i = 0; i < $count; i++) {
+ Dart_Handle i_obj = HANDLE(Dart_NewInteger(values[i]));
+ HANDLE(Dart_ListSetAt(values_obj, i, i_obj));
+ }
+ Dart_SetReturnValue(arguments, values_obj);
+ free(values);
+''');
+ } else if (decl.isDeleter) {
+ sink.writeln('''
+ GLuint *values = NULL;
+ intptr_t n = 0;
+ HANDLE(Dart_ListLength(values_obj, &n));
+ values = static_cast<GLuint *>(malloc(sizeof(GLuint) * n));
+ for (int i = 0; i < n; i++) {
+ Dart_Handle i_obj = HANDLE(Dart_ListGetAt(values_obj, i));
+ HANDLE(Dart_IntegerToUInt(i_obj, &values[i]));
+ }
+ ${decl.name}(n, values);
+ free(values);
+''');
+ } else {
+ // Generate the actual GL function call, using the native arguments
+ // extracted above.
+ ret = '$ret ${decl.name}(${arguments.join(", ")});';
+ sink..writeln(ret)..writeln(retHandle);
+ }
// If we acquired any TypedData while processing arguments above, release
// it now.
@@ -483,6 +509,9 @@
return [type, name];
}
+ static RegExp generatorFunction = new RegExp(r'glGen[A-Z]');
+ static RegExp deleterFunction = new RegExp(r'glDelete[A-Z]');
+
CDecl(String string) {
var left = (string.split('(')[0].trim().split(ws)..removeLast()).join(" ");
var right = string.split('(')[0].trim().split(ws).last;
@@ -490,10 +519,16 @@
name = norms[1];
returnType = norms[0];
+ int noName = 0;
for (var arg
in removeTrailing(string.split('(')[1], 2).trim().split(comma)) {
right = arg.split(ws).last;
left = (arg.split(ws)..removeLast()).join(" ");
+ if (left == '' && right != "void") {
+ // API without explicitly named variable
+ left = right;
+ right = 'noName${noName++}';
+ }
arguments.add(new Pair.fromList(normalizePointer(left, right)));
}
@@ -504,6 +539,7 @@
needsManualBinding = true;
print("$name RETURN TYPE NEEDS MANUAL BINDING: $returnType");
}
+ var reason = '';
dartArguments = arguments.map((pair) {
if (pair.right == "void") return new Pair("", "void");
var type = argumentTypeHint['$pair'];
@@ -512,16 +548,38 @@
}
type = typeMap[pair.left];
if (type == null) {
+ reason = '${reason} Unknown type: ${pair.left}';
needsManualBinding = true;
- return new Pair(null, null);
+ return new Pair(null, pair.right);
}
return new Pair(type, pair.right);
}).toList();
+
+ if (isGenerator) {
+ dartReturnType = 'List<int>';
+ dartArguments = [new Pair('int', arguments[0].right)];
+ needsManualBinding = false;
+ } else if (isDeleter) {
+ dartReturnType = 'void';
+ dartArguments = [new Pair('List<int>', 'values')];
+ needsManualBinding = false;
+ }
if (needsManualBinding) {
- print("$name NEEDS MANUAL BINDINGS: $string");
+ print("$name NEEDS MANUAL BINDINGS: $string$reason, "
+ "Discovered: $arguments $dartArguments");
}
}
+ bool get isGenerator =>
+ name.startsWith(generatorFunction) &&
+ arguments.length == 2 &&
+ typeMap[arguments.first.left] == 'int';
+
+ bool get isDeleter =>
+ name.startsWith(deleterFunction) &&
+ arguments.length == 2 &&
+ typeMap[arguments.first.left] == 'int';
+
String get nativeName => '${name}_native';
String toString() => '$returnType $name(${arguments.join(', ')}); '
@@ -529,14 +587,6 @@
/// These functions have manual bindings defined in lib/src/manual_bindings.cc
static final Set<String> manualBindings = new Set.from([
- "glDeleteBuffers",
- "glDeleteFramebuffers",
- "glDeleteRenderbuffers",
- "glDeleteTextures",
- "glGenBuffers",
- "glGenFramebuffers",
- "glGenRenderbuffers",
- "glGenTextures",
"glGetActiveAttrib",
"glGetActiveUniform",
"glGetAttachedShaders",
@@ -572,14 +622,13 @@
class CConst {
static final ws = new RegExp(r'\s+');
+ static final defineReg =
+ new RegExp(r'#define (GL_[_A-Za-z0-9]+)\s*(0x[0-9a-fA-F]+|[0-9]+)');
+
String name;
String value;
- CConst(String string) {
- var norms = string.trim().split(ws);
- name = norms[0];
- value = norms[1];
- }
+ CConst(this.name, this.value);
String toString() => 'const int $name = $value;';
}