From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/GfxDevice/opengl/GenerateGLExtensionDef.pl | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Runtime/GfxDevice/opengl/GenerateGLExtensionDef.pl (limited to 'Runtime/GfxDevice/opengl/GenerateGLExtensionDef.pl') 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 () +{ + 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 -- cgit v1.1-26-g67d0