qzdoom/src/gl/shaders/gl_postprocessshaderinstance.h
Christoph Oelckers 1fc4c9801b - moved all GLDEFS parsing into a dedicated source file.
- split gl_postprocessshader.h in two so that the hardware independent part can be used by GLDEFS without pulling in all of OpenGL.
2018-04-02 12:28:20 +02:00

42 lines
857 B
C++

#pragma once
#include "gl_shaderprogram.h"
#include <map>
struct PostProcessShader;
class PostProcessShaderInstance
{
public:
PostProcessShaderInstance(PostProcessShader *desc) : Desc(desc) { }
~PostProcessShaderInstance();
void Run();
PostProcessShader *Desc;
private:
bool IsShaderSupported();
void CompileShader();
void UpdateUniforms();
void BindTextures();
FShaderProgram mProgram;
FBufferedUniformSampler mInputTexture;
std::map<FTexture*, int> mTextureHandles;
};
class FCustomPostProcessShaders
{
public:
FCustomPostProcessShaders();
~FCustomPostProcessShaders();
void Run(FString target);
private:
std::vector<std::unique_ptr<PostProcessShaderInstance>> mShaders;
FCustomPostProcessShaders(const FCustomPostProcessShaders &) = delete;
FCustomPostProcessShaders &operator=(const FCustomPostProcessShaders &) = delete;
};