refactor into files

This commit is contained in:
2025-12-30 15:17:18 +01:00
parent d3eae79aa3
commit ce19309e05
12 changed files with 330 additions and 156 deletions

16
src/main/cpp/shader.h Normal file
View 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);
};