source: trunk/src/opengl/util/glsl_to_include.sh@ 440

Last change on this file since 440 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

  • Property svn:executable set to *
File size: 829 bytes
Line 
1#! /bin/sh
2
3# Compile a .glsl file to a file that can be included in a C++ program
4USAGE="Usage: $0 <file.glsl>"
5CGC=cgc
6CGC_PROFILE=arbfp1
7
8if test $# -ne 1
9then
10 echo $USAGE
11 exit 1
12fi
13
14GLSL_FILE=$1
15FRAG_FILE=`basename $1 .glsl`.frag
16#GLSL_INC_FILE=`basename $1 .glsl`.glsl_quoted
17
18echo "// Generated by src/opengl/util/$0 from $1" > $FRAG_FILE
19$CGC -quiet -oglsl -profile $CGC_PROFILE $GLSL_FILE | while read line
20do
21 if test `echo $line | cut -c1` != "#"
22 then
23 echo -e \"$line\" >> $FRAG_FILE
24 fi
25done
26echo "; // Generated by src/opengl/util/$0 from $1" >> $FRAG_FILE
27
28#echo "// Generated by src/opengl/util/$0 from $1" > $GLSL_INC_FILE
29#cat $GLSL_FILE | while read line
30#do
31# printf \"%s\\\\n\"\\n "$line" >> $GLSL_INC_FILE
32#done
33#echo "; // Generated by src/opengl/util/$0 from $1" >> $GLSL_INC_FILE
Note: See TracBrowser for help on using the repository browser.