refactor into files
This commit is contained in:
16
src/main/cpp/shader.h
Normal file
16
src/main/cpp/shader.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#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);
|
||||
};
|
||||
Reference in New Issue
Block a user