1
0
Fork 0
Univerxel/src/client/render/gl/pass/Program.hpp

41 lines
998 B
C++
Raw Normal View History

2020-07-06 19:18:29 +00:00
#pragma once
2020-09-13 09:30:48 +00:00
#include <GL/gl3w.h>
2020-07-06 19:18:29 +00:00
#include <string>
#include <vector>
2020-07-10 17:49:16 +00:00
#include <glm/glm.hpp>
2020-07-06 19:18:29 +00:00
#include "Shader.hpp"
2020-07-25 16:45:03 +00:00
#include "../buffer/Abstract.hpp"
2020-07-06 19:18:29 +00:00
2020-09-26 22:05:43 +00:00
namespace render {
struct passOptions;
}
2020-09-14 16:03:21 +00:00
namespace render::gl {
2020-09-26 22:05:43 +00:00
class Renderer;
2020-09-14 16:03:21 +00:00
}
2020-07-25 16:45:03 +00:00
/// OpenGL programs
namespace pass {
/// OpenGL shaders pipeline
class Program {
public:
virtual ~Program();
2020-07-06 19:18:29 +00:00
2020-07-25 16:45:03 +00:00
/// Bind program
void useIt();
2020-07-10 17:49:16 +00:00
2020-07-25 16:45:03 +00:00
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);
2020-07-25 16:45:03 +00:00
static GLuint loadTextureCube(const std::string &name);
2020-07-06 19:18:29 +00:00
2020-07-25 16:45:03 +00:00
protected:
2020-08-30 16:35:45 +00:00
/// Get shaders name prefix
virtual std::string getName() const = 0;
Shader *loadShader(GLenum type, const std::vector<std::string> &flags = {});
2020-07-25 16:45:03 +00:00
void load(const std::vector<Shader *> &shaders);
2020-08-30 16:35:45 +00:00
2020-07-25 16:45:03 +00:00
GLuint ProgramID;
};
}