2021-01-12 07:43:34 -07:00
|
|
|
#pragma once
|
2020-01-17 12:01:02 -07:00
|
|
|
|
2021-05-08 23:15:17 -06:00
|
|
|
#include <map>
|
|
|
|
|
2020-02-02 00:36:50 -07:00
|
|
|
#ifdef __APPLE__
|
2021-05-08 23:15:17 -06:00
|
|
|
#include <OpenGL/gl3.h>
|
2020-02-02 00:36:50 -07:00
|
|
|
#else
|
2021-05-08 23:15:17 -06:00
|
|
|
#include <GLES3/gl3.h>
|
2020-02-02 00:36:50 -07:00
|
|
|
#endif
|
|
|
|
|
2021-01-12 07:43:34 -07:00
|
|
|
class GLShader {
|
|
|
|
public:
|
|
|
|
GLShader(const char *vert_src, const char *frag_src);
|
|
|
|
~GLShader();
|
|
|
|
GLuint getUniformLocation(const char * name);
|
|
|
|
GLuint prog = 0;
|
2020-01-17 12:01:02 -07:00
|
|
|
|
2021-01-12 07:43:34 -07:00
|
|
|
private:
|
|
|
|
GLuint vert = 0, frag = 0;
|
|
|
|
std::map<const char*, GLint> uniform_loc_map;
|
|
|
|
};
|