CSEngine
Loading...
Searching...
No Matches
CoreBufferContainer.cpp
1#include "CoreBufferContainer.h"
2#include "../Util/Render/SFrameBuffer.h"
3#include "../Util/Render/STexture.h"
4
5using namespace CSE;
6
7void CoreBufferContainer::InitBuffers(int width, int height) {
8 if (m_mainBuffer != nullptr)
9 ResizeBuffers(width, height);
10
11 m_mainBuffer = new SFrameBuffer();
12 m_mainBuffer->GenerateFramebuffer(SFrameBuffer::PLANE, width, height);
13 m_mainBuffer->GenerateTexturebuffer(SFrameBuffer::RENDER, GL_RGB);
14 m_mainBuffer->RasterizeFramebuffer();
15}
16
17void CoreBufferContainer::ResizeBuffers(int width, int height) {
18 m_mainBuffer->ResizeFrameBuffer(width, height);
19}
STexture * GenerateTexturebuffer(BufferType type, int channel, int level=0)
void GenerateFramebuffer(BufferDimension dimension, int width, int height)