dungeon_crawler

changeset 16:91180ee7b7d9

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 20 Aug 2012 03:40:51 +0300
parents 3a3236a4833c
children d98240a13793
files prototype/sdr/mrt0.p.glsl prototype/src/datapath.cc prototype/src/main.cc prototype/src/renderer.cc
diffstat 4 files changed, 15 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/prototype/sdr/mrt0.p.glsl	Mon Aug 20 03:40:51 2012 +0300
     1.3 @@ -0,0 +1,7 @@
     1.4 +uniform sampler2D tex_dif;
     1.5 +
     1.6 +void main()
     1.7 +{
     1.8 +	vec4 texel = texture2D(tex_dif, gl_TexCoord[0].st);
     1.9 +	gl_FragColor = texel;
    1.10 +}
     2.1 --- a/prototype/src/datapath.cc	Sun Aug 19 23:09:30 2012 +0300
     2.2 +++ b/prototype/src/datapath.cc	Mon Aug 20 03:40:51 2012 +0300
     2.3 @@ -14,6 +14,10 @@
     2.4  {
     2.5  	static std::string res;
     2.6  
     2.7 +	if(!fname) {
     2.8 +		return 0;
     2.9 +	}
    2.10 +
    2.11  	for(auto path : pathlist) {
    2.12  		res = path + "/" + std::string(fname);
    2.13  		FILE *fp = fopen(res.c_str(), "r");
     3.1 --- a/prototype/src/main.cc	Sun Aug 19 23:09:30 2012 +0300
     3.2 +++ b/prototype/src/main.cc	Mon Aug 20 03:40:51 2012 +0300
     3.3 @@ -71,6 +71,7 @@
     3.4  	glEnable(GL_MULTISAMPLE);
     3.5  
     3.6  	add_data_path("data");
     3.7 +	add_data_path("sdr");
     3.8  
     3.9  	if(!init_renderer()) {
    3.10  		return false;
     4.1 --- a/prototype/src/renderer.cc	Sun Aug 19 23:09:30 2012 +0300
     4.2 +++ b/prototype/src/renderer.cc	Mon Aug 20 03:40:51 2012 +0300
     4.3 @@ -7,13 +7,13 @@
     4.4  #include "sdr.h"
     4.5  #include "datapath.h"
     4.6  
     4.7 -#define MRT_COUNT	4
     4.8 +#define MRT_COUNT	(sizeof mrt_sdr_file / sizeof *mrt_sdr_file)
     4.9  
    4.10  static const char *mrt_sdr_file[][2] = {
    4.11 -	{0, "mrt0.p.glsl"},
    4.12 +	{0, "mrt0.p.glsl"}/*,
    4.13  	{0, "mrt1.p.glsl"},
    4.14  	{0, "mrt2.p.glsl"},
    4.15 -	{0, "mrt3.p.glsl"}
    4.16 +	{0, "mrt3.p.glsl"}*/
    4.17  };
    4.18  
    4.19  static unsigned int mrt_prog[MRT_COUNT];