SparrowRenderer/src/shadersource.h

36 lines
578 B
C++

#ifndef SHADERSOURCE_H
#define SHADERSOURCE_H
#include <string>
#include <vector>
class Shader;
class ShaderSource
{
public:
enum SourceType
{
VERTEX,
GEOMETRY,
FRAGMENT,
NB_TYPES
};
ShaderSource();
~ShaderSource();
void setSource(const char *source, SourceType type);
Shader* compile(unsigned int geomFlags, unsigned int lightFlags);
Shader* compile(const std::vector<const char*> &defines);
private:
std::string* sources[NB_TYPES];
static std::string m_utilsSource;
};
#endif // SHADERSOURCE_H