Better abstraction for shader programs

This commit is contained in:
Emmanuel BENOîT 2017-09-30 12:08:18 +02:00
parent 4ff19bffa6
commit 7d16b704b5
5 changed files with 115 additions and 37 deletions

View file

@ -126,6 +126,35 @@ struct T_ShaderCode
std::vector< char* > code;
};
struct T_ShaderProgram
{
T_ShaderProgram( ) = delete;
T_ShaderProgram( T_ShaderProgram const& ) = delete;
T_ShaderProgram( T_ShaderProgram&& ) = delete;
T_ShaderProgram(
__rd__ GLenum programType ,
__rw__ T_FilesWatcher& watcher );
~T_ShaderProgram( );
void addChunk( __rd__ std::string const& string );
void addFile( __rd__ std::string const& source );
void load( );
bool activate( ) const;
private:
T_WatchedFiles files_;
std::vector< bool > chunksOrFiles_;
std::vector< std::string > parts_;
std::vector< std::string > errors_;
GLenum programType_;
GLuint program_;
};
/*= T_Camera =================================================================*/