33 lines
543 B
C++
33 lines
543 B
C++
#ifndef SHADERSOURCE_H
|
|
#define SHADERSOURCE_H
|
|
|
|
#include <string>
|
|
|
|
class Shader;
|
|
|
|
class ShaderSource
|
|
{
|
|
public:
|
|
enum SourceType
|
|
{
|
|
VERTEX,
|
|
GEOMETRY,
|
|
FRAGMENT,
|
|
NB_TYPES
|
|
};
|
|
|
|
ShaderSource();
|
|
~ShaderSource();
|
|
|
|
void addSource(const char *source, SourceType type);
|
|
|
|
Shader* compile(int nbDefines = 0, const char** defines = NULL);
|
|
|
|
private:
|
|
std::string* sources[NB_TYPES];
|
|
|
|
std::string preprocess(std::string source, int nbDefines, const char** defines);
|
|
};
|
|
|
|
#endif // SHADERSOURCE_H
|