From fb23c8d47f6dcef429423256d8dddcc0f7184fc4 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Sun, 4 Jun 2023 13:02:14 +0200 Subject: Further advances in nuklear port. Rendering now looks similar to Qt version, needs a few tweaks: * Proper multisampling * Background Missing features: * Barcharts * Interactivity (e.g. brushing/linking in all objects) * History view of interactions --- shader.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 shader.h (limited to 'shader.h') diff --git a/shader.h b/shader.h new file mode 100644 index 0000000..feb5952 --- /dev/null +++ b/shader.h @@ -0,0 +1,37 @@ +#ifndef SHADER_H +#define SHADER_H + +#include + +class Shader +{ +public: + Shader(const char *vertexSrc, const char *fragmentSrc, const char *geometrySrc = nullptr); + ~Shader(); + + GLuint program() const { return m_program; } + + GLint uniformLocation(const char *name) const; + + void setUniform(GLint location, GLint value) const; + void setUniform(GLint location, GLfloat value) const; + void setUniform(GLint location, GLfloat mat[4][4]) const; + void setUniform1dArray(GLint location, const GLfloat *values, int count) const; + void setUniform2dArray(GLint location, const GLfloat *values, int count) const; + void setUniform3dArray(GLint location, const GLfloat *values, int count) const; + + void setUniform(const char *name, GLint value) const; + void setUniform(const char *name, GLfloat value) const; + void setUniform(const char *name, GLfloat mat[4][4]) const; + void setUniform1dArray(const char *name, const GLfloat *values, int count) const; + void setUniform2dArray(const char *name, const GLfloat *values, int count) const; + void setUniform3dArray(const char *name, const GLfloat *values, int count) const; + + void use() const; + void release() const; + +private: + GLuint m_program; +}; + +#endif // SHADER_H -- cgit v1.2.3