goat3dgfx

diff src/shader.h @ 24:dc5918c62a64

broken: converting to resman
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Mar 2014 22:04:29 +0200
parents 6f82b9b6d6c3
children
line diff
     1.1 --- a/src/shader.h	Tue Feb 25 23:47:48 2014 +0200
     1.2 +++ b/src/shader.h	Sat Mar 01 22:04:29 2014 +0200
     1.3 @@ -2,6 +2,7 @@
     1.4  #define SHADER_H_
     1.5  
     1.6  #include <vector>
     1.7 +#include <string>
     1.8  #include "vmath/vmath.h"
     1.9  #include "opengl.h"
    1.10  #include "dataset.h"
    1.11 @@ -19,7 +20,7 @@
    1.12  private:
    1.13  	unsigned int sdr;
    1.14  	unsigned int type;
    1.15 -	char *name;
    1.16 +	std::string name, src;
    1.17  
    1.18  public:
    1.19  	Shader();
    1.20 @@ -34,6 +35,13 @@
    1.21  	void destroy();
    1.22  
    1.23  	bool load(const char *fname, unsigned int type);
    1.24 +
    1.25 +
    1.26 +	// these functions are only meant to be used by the ShaderSet
    1.27 +	static Shader *create_shader();
    1.28 +	static bool load_shader(Shader *sdr, const char *fname);
    1.29 +	static bool done_shader(Shader *sdr, unsigned int type);
    1.30 +	static void destroy_shader(Shader *sdr);
    1.31  };
    1.32  
    1.33  #define VSDR(s)		s, GL_VERTEX_SHADER