Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Shader
- {
- public:
- enum Type
- {
- NONE = 0,
- VERTEX = 1,
- FRAGMENT = 2,
- GEOMETRY = 3,
- TESSELATION_CONTROL = 4
- };
- static const Shader* currentlyBound;
- Shader() = default;
- virtual ~Shader() = default;
- virtual void* CreateShader(const std::string& shader, Type type) { return nullptr; }
- virtual void CreateAndUseProgram(const void* shaders, int shaderCount) {}
- virtual void UseProgram() const {}
- virtual void UnuseProgram() const {}
- virtual int getUniformLocation(const std::string &uniformName) const { return 0; }
- virtual void Free() {}
- template<typename T>
- T getShaderProgram()
- {
- return static_cast<T>(getProgram());
- }
- virtual void Uniform1i(const std::string& name, int value) {}
- virtual void Uniform1f(const std::string& name, float value) {}
- virtual void Uniform1d(const std::string& name, double value) {}
- virtual void Uniform1iv(const std::string& name, Uint count, const int* value) {}
- virtual void Uniform1fv(const std::string& name, Uint count, const float* value) {}
- virtual void Uniform1dv(const std::string& name, Uint count, const double* value) {}
- virtual void Uniform2i(const std::string& name, int value0, int value1) {}
- virtual void Uniform2f(const std::string& name, float value0, float value) {}
- virtual void Uniform2d(const std::string& name, double value0, double value) {}
- virtual void Uniform2iv(const std::string& name, Uint count, const int* value) {}
- virtual void Uniform2fv(const std::string& name, Uint count, const float* value) {}
- virtual void Uniform2dv(const std::string& name, Uint count, const double* value) {}
- virtual void Uniform3i(const std::string& name, int value0, int value1, int value2) {}
- virtual void Uniform3f(const std::string& name, float value0, float value, float value2) {}
- virtual void Uniform3d(const std::string& name, double value0, double value, double value2) {}
- virtual void Uniform3iv(const std::string& name, Uint count, const int* value) {}
- virtual void Uniform3fv(const std::string& name, Uint count, const float* value) {}
- virtual void Uniform3dv(const std::string& name, Uint count, const double* value) {}
- virtual void Uniform4i(const std::string& name, int value0, int value1, int value2, int value3) {}
- virtual void Uniform4f(const std::string& name, float value0, float value, float value2, float value3) {}
- virtual void Uniform4d(const std::string& name, double value0, double value, double value2, double value4) {}
- virtual void Uniform4iv(const std::string& name, Uint count, const int* value) {}
- virtual void Uniform4fv(const std::string& name, Uint count, const float* value) {}
- virtual void Uniform4dv(const std::string& name, Uint count, const double* value) {}
- virtual void UniformMatrix4fv(const std::string& name, const Mat4& matrix) {}
- virtual void UniformMatrix4dv(const std::string& name, const Mat4& matrix) {}
- protected:
- virtual inline void* getProgram() const { return nullptr; }
- Type type = Type::NONE;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement