aboutsummaryrefslogtreecommitdiffstats
path: root/yage/core/glslprogram.h
diff options
context:
space:
mode:
Diffstat (limited to 'yage/core/glslprogram.h')
-rw-r--r--yage/core/glslprogram.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/yage/core/glslprogram.h b/yage/core/glslprogram.h
index 50b2a7de..9e49d329 100644
--- a/yage/core/glslprogram.h
+++ b/yage/core/glslprogram.h
@@ -1,5 +1,5 @@
-/* ----------------------------------------------------------------------------
- * glslprogram.h
+/** ---------------------------------------------------------------------------
+ * @file: glslprogram.h
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
@@ -28,8 +28,10 @@ public:
GlslProgram &operator=(GlslProgram &&) = delete;
/// compiles vertex and fragment shader
- void compileShaders(const std::string &vertex_shader_path,
- const std::string &fragment_shader_path);
+ void compileShaders(const std::string &vertexShader,
+ const std::string fragmentShader);
+ void compileShadersFromFile(const std::string &vertex_shader_path,
+ const std::string &fragment_shader_path);
void linkShaders();
void addAttribute(const std::string &attribute_name);
GLint getUniformLocation(const std::string &uniform_name);
@@ -46,7 +48,9 @@ private:
int attribute_index_ = 0;
/// compiles one shader
- void compileShader(const GLuint &shader, const std::string &file_path);
+ void compileShader(GLuint shader, const std::string &shaderContent);
+ void compileShaderFromFile(GLuint shader, const std::string &file_path);
+ void initShaderId();
};
} // namespace yage