1 #ifndef _SHADERPROGRAM_H
2 #define _SHADERPROGRAM_H
11 * The "Shader" class represents a GLSL program made from shaders.
16 ShaderProgram() : m_program(0) {}
18 bool AttachVertexProgram(const char *src);
19 bool AttachFragmentProgram(const char *src);
21 const void Use() const;
22 // Unfortunately, we don't require GL 4.3/ARB_explicit_uniform_location
23 // which would make this obsolete. One uday Mesa will support it.
24 // NOTE: We could actually get away with this by only using UBOs, as
25 // Mesa supports ARB_shading_language_420pack, but that'd be a bit more
26 // work right with the way some of our uniforms are laid out at the moment.
27 const GLint GetUniformLocation(const char *uniform_name) const;
29 void LazyCreateProgram();
30 bool AttachShader(const char *src, GLenum type);
37 std::vector<Shader> m_shaders;
42 #endif // _SHADERPROGRAM_H