37 lines
750 B
C++
37 lines
750 B
C++
#pragma once
|
|
#include <string>
|
|
#include <map>
|
|
#include <GL/glew.h>
|
|
#include "Shader.h"
|
|
#include "SceneContext.h"
|
|
|
|
class Multipass
|
|
{
|
|
public:
|
|
Multipass();
|
|
|
|
~Multipass();
|
|
|
|
void setDrawBuffers();
|
|
void bindToFrameBuffer(GLenum type, GLenum texture, std::string texName);
|
|
|
|
void addTexture(const std::string &tex_name, GLuint filter, GLuint type, GLuint type_2,
|
|
bool depth, SceneContext &scnctx);
|
|
|
|
void enableFrameBufferTexture(const std::string tex_name);
|
|
void drawResultToScreen(SceneContext &scnctx);
|
|
private:
|
|
|
|
void _createQuad();
|
|
|
|
GLuint _fboId;
|
|
|
|
GLuint _quad_vao;
|
|
GLuint _quad_vbo;
|
|
Shader _quad_shader;
|
|
std::string _current_tex;
|
|
std::map<std::string, GLuint> _pass_textures;
|
|
|
|
GLenum _draw_buffers[5];
|
|
GLuint _draw_buffers_size;
|
|
}; |