aboutsummaryrefslogtreecommitdiff
path: root/src/shader/wrap
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader/wrap')
-rw-r--r--src/shader/wrap/graphic_shader.cc10
-rw-r--r--src/shader/wrap/graphic_shader.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/shader/wrap/graphic_shader.cc b/src/shader/wrap/graphic_shader.cc
index 0ed37ff..c891730 100644
--- a/src/shader/wrap/graphic_shader.cc
+++ b/src/shader/wrap/graphic_shader.cc
@@ -15,6 +15,16 @@ GraphicShader::Guard GraphicShader::use() const {
return Guard(_id);
}
+GraphicShader::GraphicShader(const std::string& vertex,
+ const std::string& geometry,
+ const std::string fragment):
+ _id(glCreateProgram()) {
+ glAttachShader(_id, util::compileShader(vertex, GL_VERTEX_SHADER));
+ glAttachShader(_id, util::compileShader(geometry, GL_GEOMETRY_SHADER));
+ glAttachShader(_id, util::compileShader(fragment, GL_FRAGMENT_SHADER));
+ glLinkProgram(_id);
+}
+
GraphicShader::GraphicShader(const std::string& vertex, const std::string fragment):
_id(glCreateProgram()) {
glAttachShader(_id, util::compileShader(vertex, GL_VERTEX_SHADER));
diff --git a/src/shader/wrap/graphic_shader.h b/src/shader/wrap/graphic_shader.h
index 25a5efb..dcae6db 100644
--- a/src/shader/wrap/graphic_shader.h
+++ b/src/shader/wrap/graphic_shader.h
@@ -20,6 +20,7 @@ public:
Guard use() const;
+ GraphicShader(const std::string& vertex, const std::string& geometry, const std::string fragment);
GraphicShader(const std::string& vertex, const std::string fragment);
~GraphicShader();