17 lines
406 B
C++
17 lines
406 B
C++
#pragma once
|
|
#include <glad/gles2.h>
|
|
#include <string>
|
|
|
|
class Shader
|
|
{
|
|
GLuint m_program = 0;
|
|
public:
|
|
void destroy();
|
|
bool load(const std::string& vertexFilename, const std::string& fragmentFilename);
|
|
void use() const;
|
|
GLint getUniformLocation(const char* name) const;
|
|
GLint getAttribLocation(const char* name) const;
|
|
private:
|
|
GLuint compile(GLenum type, const char* source);
|
|
};
|