From d98bc0b654b97d130338e76e0928296f84e6d6fd Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 16 Jan 2015 13:59:17 +0100 Subject: opengl: add shader build infrastructure perl script to transform shader programs into c include files with static string constands containing the shader programs, so we can easily embed them into qemu. Also some Makefile logic for them. Signed-off-by: Gerd Hoffmann Reviewed-by: Max Reitz --- scripts/shaderinclude.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 scripts/shaderinclude.pl (limited to 'scripts') diff --git a/scripts/shaderinclude.pl b/scripts/shaderinclude.pl new file mode 100644 index 0000000..81b5146 --- /dev/null +++ b/scripts/shaderinclude.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl +use strict; +use warnings; + +my $file = shift; +open FILE, "<", $file or die "open $file: $!"; +my $name = $file; +$name =~ s|.*/||; +$name =~ s/[-.]/_/g; +print "static GLchar ${name}_src[] =\n"; +while () { + chomp; + printf " \"%s\\n\"\n", $_; +} +print " \"\\n\";\n"; +close FILE; -- cgit v1.1