/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2020. All rights reserved. * Description: ShaderProgram * Author: * Create: 2019-08-09 */ #ifndef SHADER_PROGRAM_H #define SHADER_PROGRAM_H #include #include #include "DFXDefine.h" namespace dolgles { class ShaderProgram { public: ShaderProgram(); ~ShaderProgram(); GLuint CreateProgram(const std::string &vertexSource, const std::string &fragmentSource) const; void ReleaseProgram(GLuint program) const; GLint GetAttribLocation(GLuint program, const std::string &name) const; GLint GetUniformLocation(GLuint program, const std::string &name) const; private: void PrintLog(GLuint object) const; GLuint LoadShader(GLenum shaderType, const std::string &source) const; GLuint LinkShaderProgram(GLuint vShader, GLuint fShader) const; }; }; // namespace dolgles #endif // end SHADER_PROGRAM_H