invisible

diff src/sdr.cc @ 23:b50ad2711f5f

fixed fov aspect projection et c, added shaders todo: segmentation
author Eleni Maria Stea <eleni@mutantstargoat.com>
date Sat, 16 Nov 2013 23:29:15 +0200
parents 38bf3eec0fac
children
line diff
     1.1 --- a/src/sdr.cc	Sun Nov 10 14:32:29 2013 +0200
     1.2 +++ b/src/sdr.cc	Sat Nov 16 23:29:15 2013 +0200
     1.3 @@ -25,14 +25,16 @@
     1.4  	ctr = ftell(fp);
     1.5  	rewind(fp);
     1.6  
     1.7 -	char *glsl = NULL;
     1.8 +	char *glsl;
     1.9  	if(!(glsl = (char*) malloc(ctr + 1))) {
    1.10  		perror("Failed to allocate memory");
    1.11  		return 0;
    1.12  	}
    1.13 -	ctr = fread(glsl, 1, ctr, fp);
    1.14 +	fread(glsl, 1, ctr, fp);
    1.15  	fclose(fp);
    1.16  
    1.17 +	glsl[ctr] = 0;
    1.18 +
    1.19  	return glsl;
    1.20  }
    1.21