3dphotoshoot

diff src/shader.h @ 21:4ca4e3c5a754

port to C++ completed, shader programs now use the SdrProg class
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 11 Jun 2015 04:56:33 +0300
parents c14613d27a3a
children d7fe157c402d
line diff
     1.1 --- a/src/shader.h	Thu Jun 11 02:53:43 2015 +0300
     1.2 +++ b/src/shader.h	Thu Jun 11 04:56:33 2015 +0300
     1.3 @@ -3,6 +3,15 @@
     1.4  
     1.5  #include <vector>
     1.6  
     1.7 +enum SdrDefaultAttrib {
     1.8 +	SDR_ATTR_VERTEX,
     1.9 +	SDR_ATTR_NORMAL,
    1.10 +	SDR_ATTR_TEXCOORD,
    1.11 +	SDR_ATTR_COLOR,
    1.12 +	SDR_ATTR_TANGENT
    1.13 +};
    1.14 +
    1.15 +
    1.16  class SdrProg {
    1.17  private:
    1.18  	std::vector<unsigned int> priv_sdr;
    1.19 @@ -10,6 +19,8 @@
    1.20  	mutable bool valid;
    1.21  
    1.22  public:
    1.23 +	static const SdrProg *active;
    1.24 +
    1.25  	SdrProg();
    1.26  	~SdrProg();
    1.27  
    1.28 @@ -27,10 +38,15 @@
    1.29  	int get_uniform(const char *name) const;
    1.30  	int get_attrib(const char *name) const;
    1.31  	bool bind_attrib(const char *name, int loc) const;
    1.32 +	void bind_default_attribs() const;
    1.33  
    1.34  	bool bind() const;
    1.35 +
    1.36 +	unsigned int get_globj() const { return prog; }
    1.37  };
    1.38  
    1.39  unsigned int get_shader(const char *name, unsigned int type);
    1.40  
    1.41 +SdrProg *get_sdrprog(const char *vfile, const char *pfile);
    1.42 +
    1.43  #endif	/* SHADER_H_ */