33 lines
921 B
C++
33 lines
921 B
C++
#pragma once
|
|
|
|
#include <GL/glew.h>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <glm/glm.hpp>
|
|
|
|
#include "Shader.hpp"
|
|
#include "../buffer/Buffer.hpp"
|
|
|
|
class Renderer;
|
|
/// OpenGL shaders pipeline
|
|
class Program {
|
|
public:
|
|
virtual ~Program();
|
|
|
|
void useIt();
|
|
virtual std::string getName() const = 0;
|
|
|
|
virtual void start(Renderer*) = 0;
|
|
virtual Buffer::params setup(Renderer*, glm::mat4 modelMatrix) = 0;
|
|
|
|
static GLuint loadTexture(const std::string &name, bool linear = true);
|
|
static GLuint loadRawTexture(const std::string &name);
|
|
static GLuint loadTextureArray(const std::vector<std::string> &names, const std::string &suffix = "", float mipMapLOD = 0);
|
|
static GLuint loadTextureCube(const std::string &name);
|
|
|
|
protected:
|
|
void load(const std::vector<Shader *> &shaders);
|
|
virtual Shader *loadShader(GLenum type, const std::vector<std::string> &flags = {});
|
|
GLuint ProgramID;
|
|
};
|