CSEngine
Loading...
Searching...
No Matches
SRenderGroup.cpp
1#include "SRenderGroup.h"
2#include "CameraBase.h"
3#include "SFrameBuffer.h"
4#include "../../Manager/Render/RenderMgr.h"
5#include "STexture.h"
6#include "../GLProgramHandle.h"
7
8using namespace CSE;
9
10void SRenderGroup::BindSourceBuffer(const SFrameBuffer& buffer, const GLProgramHandle& handle, int layout) {
11 const auto& srcBufferTexture = buffer.GetMainColorTexture();
12 const auto& uniforms = handle.Uniforms;
13 const auto& size = buffer.GetSize();
14 const float sizeRaw[2] = { static_cast<float>(size.x), static_cast<float>(size.y) };
15 if(srcBufferTexture == nullptr) return;
16
17 if(uniforms.SourceBuffer >= 0)
18 srcBufferTexture->Bind(uniforms.SourceBuffer, layout);
19 if(uniforms.SourceBufferSize >= 0)
20 glUniform2fv(uniforms.SourceBufferSize, 1, sizeRaw);
21}
STexture * GetMainColorTexture() const
static void BindSourceBuffer(const SFrameBuffer &buffer, const GLProgramHandle &handle, int layout)