Inferno Game Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

41 lines
803 B

#ifndef SHADER_H
#define SHADER_H
#define INFO_LOG_SIZE 512
#include <cstdint> // std::int32_t, std::uint32_t
#include <string> // std::string
#include <glm/glm.hpp>
namespace Inferno {
class Shader {
public:
Shader(const std::string &vertexSource, const std::string &fragmentSource);
~Shader();
// -----------------------------------------
void bind() const;
void unbind() const;
// -----------------------------------------
uint32_t getProgram() const;
// -----------------------------------------
protected:
uint32_t compileShader(int32_t type, const char* shaderSource) const;
uint32_t linkShader(uint32_t vertex, uint32_t fragment) const;
int32_t checkStatus(uint32_t check, bool isProgram = false) const;
private:
uint32_t m_program;
};
}
#endif // SHADER_H