45 lines
1.3 KiB
C++
45 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include "OpenGLRenderer.h"
|
|
#include "ShaderTypes.h"
|
|
|
|
#include <functional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class OpenGLRenderPass
|
|
{
|
|
public:
|
|
using LayerProgram = OpenGLRenderer::LayerProgram;
|
|
using TextBindingUpdater = std::function<bool(const RuntimeRenderState&, LayerProgram::TextBinding&, std::string&)>;
|
|
using GlobalParamsUpdater = std::function<bool(const RuntimeRenderState&, unsigned, unsigned)>;
|
|
|
|
explicit OpenGLRenderPass(OpenGLRenderer& renderer);
|
|
|
|
void Render(
|
|
bool hasInputSource,
|
|
const std::vector<RuntimeRenderState>& layerStates,
|
|
unsigned inputFrameWidth,
|
|
unsigned inputFrameHeight,
|
|
unsigned historyCap,
|
|
const TextBindingUpdater& updateTextBinding,
|
|
const GlobalParamsUpdater& updateGlobalParams);
|
|
|
|
private:
|
|
void RenderDecodePass(unsigned inputFrameWidth, unsigned inputFrameHeight);
|
|
void RenderShaderProgram(
|
|
GLuint sourceTexture,
|
|
GLuint destinationFrameBuffer,
|
|
LayerProgram& layerProgram,
|
|
const RuntimeRenderState& state,
|
|
unsigned inputFrameWidth,
|
|
unsigned inputFrameHeight,
|
|
unsigned historyCap,
|
|
const TextBindingUpdater& updateTextBinding,
|
|
const GlobalParamsUpdater& updateGlobalParams);
|
|
void BindLayerTextureAssets(const LayerProgram& layerProgram);
|
|
void UnbindLayerTextureAssets(const LayerProgram& layerProgram, unsigned historyCap);
|
|
|
|
OpenGLRenderer& mRenderer;
|
|
};
|