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& uniforms = handle.Uniforms;
12 const auto& size = buffer.GetSize();
13 const float sizeRaw[2] = { static_cast<float>(size.x), static_cast<float>(size.y) };
14
15 if(uniforms.SourceBuffer >= 0) {
16 const auto& texture = buffer.BlitCopiedFrameBuffer();
17
18 buffer.AttachFrameBuffer();
19 texture->Bind(uniforms.SourceBuffer, layout);
20 }
21 if(uniforms.SourceBufferSize >= 0)
22 glUniform2fv(uniforms.SourceBufferSize, 1, sizeRaw);
23}
static void BindSourceBuffer(const SFrameBuffer &buffer, const GLProgramHandle &handle, int layout)