summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/opengl/GenerateGLExtensionDef.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/GfxDevice/opengl/GenerateGLExtensionDef.pl')
-rw-r--r--Runtime/GfxDevice/opengl/GenerateGLExtensionDef.pl48
1 files changed, 48 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/opengl/GenerateGLExtensionDef.pl b/Runtime/GfxDevice/opengl/GenerateGLExtensionDef.pl
new file mode 100644
index 0000000..81310df
--- /dev/null
+++ b/Runtime/GfxDevice/opengl/GenerateGLExtensionDef.pl
@@ -0,0 +1,48 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+open FH, "GLExtensionDefs.txt" or die $_;
+
+my$ output = "// This file is automatically generated with Runtime/GfxDevice/opengl/GenerateGLExtensionDef.pl.\n// It is generated from GLExtensionDefs.txt\n";
+
+LINE:
+while (<FH>)
+{
+ my $line = $_;
+ chomp ($line);
+
+ if ($line =~ /^\s*\/\/\s*(.*)/)
+ {
+ $output = $output . "$line\n";
+ }
+ elsif ($line =~ /^\s*\#\s*(.*)/)
+ {
+ $output = $output . "$line\n";
+ }
+ elsif ($line =~ /^\s* s*(.*)/)
+ {
+ $output = $output . "$line\n";
+ }
+ elsif ($line =~ /^\s*$/)
+ {
+ $output = $output . "$line\n";
+ }
+ else
+ {
+ my$ name = $line;
+ my$ pfn = uc ($line);
+ if ($line =~ /^(.+)->(.+)/)
+ {
+ $name = $1;
+ $pfn = uc ($2);
+ }
+ my $upperLine = uc ($line);
+ $output = $output . "DEF (PFN" . $pfn . "PROC, $name);\n";
+ $output = $output . "#define $name UNITYGL_$name\n";
+ }
+}
+
+open OUT, "> GLExtensionDefs.h";
+print OUT $output; \ No newline at end of file