41 lines
998 B
C++
41 lines
998 B
C++
#pragma once
|
|
|
|
#include <GL/gl3w.h>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <glm/glm.hpp>
|
|
|
|
#include "Shader.hpp"
|
|
#include "../buffer/Abstract.hpp"
|
|
|
|
namespace render {
|
|
struct passOptions;
|
|
}
|
|
namespace render::gl {
|
|
class Renderer;
|
|
}
|
|
/// OpenGL programs
|
|
namespace pass {
|
|
/// OpenGL shaders pipeline
|
|
class Program {
|
|
public:
|
|
virtual ~Program();
|
|
|
|
/// Bind program
|
|
void useIt();
|
|
|
|
static GLuint loadTexture(const std::string &name, bool linear = true);
|
|
static GLuint loadTextureArray(const std::vector<std::string> &names, const std::string &suffix = "", float mipMapLOD = 0, float anisotropy = 0);
|
|
static GLuint loadTextureCube(const std::string &name);
|
|
|
|
protected:
|
|
/// Get shaders name prefix
|
|
virtual std::string getName() const = 0;
|
|
|
|
Shader *loadShader(GLenum type, const std::vector<std::string> &flags = {});
|
|
void load(const std::vector<Shader *> &shaders);
|
|
|
|
GLuint ProgramID;
|
|
};
|
|
}
|