Search
lxdream.org :: lxdream/src/tools/genglsl.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/tools/genglsl.c
changeset 736:a02d1475ccfd
prev561:533f6b478071
next968:6fb1481859a4
author nkeynes
date Thu Oct 30 23:56:59 2008 +0000 (15 years ago)
permissions -rw-r--r--
last change Add --enable-profiled configure option for convenience (and enable fastcall only on fully optimized builds)
file annotate diff log raw
1.1 --- a/src/tools/genglsl.c Tue Jan 01 05:08:38 2008 +0000
1.2 +++ b/src/tools/genglsl.c Thu Oct 30 23:56:59 2008 +0000
1.3 @@ -28,38 +28,38 @@
1.4 int ch;
1.5
1.6 while( (ch = fgetc(in)) != EOF ) {
1.7 - if( ch == '\"' ) {
1.8 - fputc( '\\', out );
1.9 - } else if( ch == '\n') {
1.10 - fputs( "\\n\\", out );
1.11 - }
1.12 - fputc( ch, out );
1.13 + if( ch == '\"' ) {
1.14 + fputc( '\\', out );
1.15 + } else if( ch == '\n') {
1.16 + fputs( "\\n\\", out );
1.17 + }
1.18 + fputc( ch, out );
1.19 }
1.20 }
1.21
1.22 int main( int argc, char *argv[] )
1.23 {
1.24 if( argc != 4 ) {
1.25 - fprintf( stderr, "Usage: genglsl <vertex-shader-file> <fragment-shader-file> <output-file>\n");
1.26 - exit(1);
1.27 + fprintf( stderr, "Usage: genglsl <vertex-shader-file> <fragment-shader-file> <output-file>\n");
1.28 + exit(1);
1.29 }
1.30
1.31 FILE *vsin = fopen( argv[1], "ro" );
1.32 if( vsin == NULL ) {
1.33 - perror( "Unable to open vertex shader source" );
1.34 - exit(2);
1.35 + perror( "Unable to open vertex shader source" );
1.36 + exit(2);
1.37 }
1.38
1.39 FILE *fsin = fopen( argv[2], "ro" );
1.40 if( fsin == NULL ) {
1.41 - perror( "Unable to open fragment shader source" );
1.42 - exit(2);
1.43 + perror( "Unable to open fragment shader source" );
1.44 + exit(2);
1.45 }
1.46
1.47 FILE *out = fopen( argv[3], "wo" );
1.48 if( out == NULL ) {
1.49 - perror( "Unable to open output file" );
1.50 - exit(2);
1.51 + perror( "Unable to open output file" );
1.52 + exit(2);
1.53 }
1.54
1.55 fprintf( out, "/**\n * This file is automatically generated - do not edit\n */\n\n" );
.