aboutsummaryrefslogtreecommitdiff
path: root/src/shader/wrap/graphic_shader.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader/wrap/graphic_shader.cc')
-rw-r--r--src/shader/wrap/graphic_shader.cc10
1 files changed, 10 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));