summaryrefslogtreecommitdiffstats
path: root/opengl/libs/tools
diff options
context:
space:
mode:
Diffstat (limited to 'opengl/libs/tools')
-rw-r--r--opengl/libs/tools/enumextract.sh32
-rwxr-xr-xopengl/libs/tools/genfiles11
-rwxr-xr-xopengl/libs/tools/glapigen15
-rwxr-xr-xopengl/libs/tools/glentrygen15
4 files changed, 31 insertions, 42 deletions
diff --git a/opengl/libs/tools/enumextract.sh b/opengl/libs/tools/enumextract.sh
deleted file mode 100644
index 5707302..0000000
--- a/opengl/libs/tools/enumextract.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-awk '
-/^#define GL_/ {
- names[count] = $2;
- values[count] = $3;
- sort[count] = $3 + 0;
- count++;
-}
-END {
- for (i = 1; i < count; i++) {
- for (j = 0; j < i; j++) {
- if (sort[i] < sort[j]) {
- tn = names[i];
- tv = values[i];
- ts = sort[i];
- names[i] = names[j];
- values[i] = values[j];
- sort[i] = sort[j];
- names[j] = tn;
- values[j] = tv;
- sort[j] = ts;
- }
- }
- }
-
- for (i = 0; i < count; i++) {
- printf("GLENUM(%s, %s)\n", names[i], values[i]);
- }
-}
-' < $1
-
diff --git a/opengl/libs/tools/genfiles b/opengl/libs/tools/genfiles
index 107768b..4f8eda4 100755
--- a/opengl/libs/tools/genfiles
+++ b/opengl/libs/tools/genfiles
@@ -15,6 +15,13 @@
# limitations under the License.
./glapigen ../../include/GLES/gl.h > ../GLES_CM/gl_api.in
-./glentrygen ../../include/GLES/gl.h > ../gl_entries.in
+./glentrygen ../../include/GLES/gl.h > ../GLES_CM/gl_entries.in
+
./glapigen ../../include/GLES/glext.h > ../GLES_CM/glext_api.in
-./glentrygen ../../include/GLES/glext.h > ../glext_entries.in
+./glentrygen ../../include/GLES/glext.h > ../GLES_CM/glext_entries.in
+
+./glapigen ../../include/GLES2/gl2.h > ../GLES2/gl2_api.in
+./glentrygen ../../include/GLES2/gl2.h > ../GLES2/gl2_entries.in
+
+./glapigen ../../include/GLES2/gl2ext.h > ../GLES2/gl2ext_api.in
+./glentrygen ../../include/GLES2/gl2ext.h > ../GLES2/gl2ext_entries.in
diff --git a/opengl/libs/tools/glapigen b/opengl/libs/tools/glapigen
index a2c3a7b..bd8dda3 100755
--- a/opengl/libs/tools/glapigen
+++ b/opengl/libs/tools/glapigen
@@ -16,16 +16,23 @@
use strict;
+sub rtrim($)
+{
+ my $string = shift;
+ $string =~ s/\s+$//;
+ return $string;
+}
+
while (my $line = <>) {
next if $line =~ /^\//;
next if $line =~ /^#/;
next if $line =~ /^\s*$/;
- if ($line !~ /^GL_API\s+(.+)\s+GL_APIENTRY\s+([\w]+)\s*\(([^\)]+)\);/) {
+ if ($line !~ /^GL_API(CALL)?\s+(.+)\s+GL_APIENTRY\s+([\w]+)\s*\(([^\)]+)\);/) {
next;
}
- my $type = $1;
- my $name = $2;
- my $args = $3;
+ my $type = rtrim($2);
+ my $name = $3;
+ my $args = $4;
#printf("%s", $line);
diff --git a/opengl/libs/tools/glentrygen b/opengl/libs/tools/glentrygen
index 5e0f7b6..170f041 100755
--- a/opengl/libs/tools/glentrygen
+++ b/opengl/libs/tools/glentrygen
@@ -16,16 +16,23 @@
use strict;
+sub rtrim($)
+{
+ my $string = shift;
+ $string =~ s/\s+$//;
+ return $string;
+}
+
while (my $line = <>) {
next if $line =~ /^\//;
next if $line =~ /^#/;
next if $line =~ /^\s*$/;
- if ($line !~ /^GL_API\s+(.+)\s+GL_APIENTRY\s+([\w]+)\s*\(([^\)]+)\);/) {
+ if ($line !~ /^GL_API(CALL)?\s+(.+)\s+GL_APIENTRY\s+([\w]+)\s*\(([^\)]+)\);/) {
next;
}
- my $type = $1;
- my $name = $2;
- my $args = $3;
+ my $type = rtrim($2);
+ my $name = $3;
+ my $args = $4;
printf("GL_ENTRY(%s, %s, %s)\n", $type, $name, $args);
}