yabba/shader.hpp
#pragma once
#include "ogl.hpp"
#include "common.hpp"
#include <vector>
class Shader {
private:
const GLuint shader;
const GLenum type;
Shader(GLuint, GLenum);
public:
static Shader* getInst(const char*, size_t);
static Shader* getInst(const char*);
operator GLuint() { return shader; }
~Shader();
GLenum getType() const { return type; }
};
class Program {
private:
GLuint program;
std::vector<Shader*> shaders;
Program(GLuint p): program(p) {}
public:
static Program* getInst();
static Program* getInst(const char*);
operator GLuint() { return program; }
~Program();
bool attach(Shader*);
};