mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-24 17:51:11 +00:00
43 lines
857 B
C
43 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;
|
||
|
};
|