#ifndef SHADER_H_
#define SHADER_H_
-enum SType {
+#include <vulkan/vulkan.h>
+
+#include <vector>
+#include <string>
+
+#include <gmath/gmath.h>
+
+class Texture;
+
+enum ShaderType {
+ SDR_UNKNOWN,
SDR_VERTEX,
SDR_FRAGMENT
};
class Shader {
-private:
- SType type;
+protected:
+ ShaderType type;
+ std::string name;
+
+ virtual bool create(char *buf, unsigned int bsz, const char *fname) = 0;
public:
Shader();
- ~Shader();
+ virtual ~Shader() = 0;
- virtual bool load(const char *fname, SType type);
+ virtual bool load(const char *fname, ShaderType type);
+ virtual void destroy() = 0;
+ virtual ShaderType get_type();
};
+/* Shader Program */
+
class ShaderProgram {
-private:
+protected:
Shader *shaders[2];
public:
ShaderProgram();
- virtual ~ShaderProgram() = 0;
+ virtual ~ShaderProgram();
- void add_shader(Shader *sdr, SType type);
- bool link();
- void bind();
+ virtual bool create() = 0;
+ virtual bool link() = 0;
+ virtual bool use() const = 0;
+ virtual void destroy() = 0;
+ virtual void attach_shader(Shader *shader) = 0;
};
#endif // SHADER_H_