Files
XCEngine/engine/src/RHI/OpenGL/OpenGLRenderPass.cpp

38 lines
987 B
C++
Raw Normal View History

#include "XCEngine/RHI/OpenGL/OpenGLRenderPass.h"
namespace XCEngine {
namespace RHI {
OpenGLRenderPass::OpenGLRenderPass() {
}
OpenGLRenderPass::~OpenGLRenderPass() {
Shutdown();
}
void OpenGLRenderPass::Shutdown() {
m_colorAttachments.clear();
m_colorAttachmentCount = 0;
m_hasDepthStencil = false;
}
bool OpenGLRenderPass::Initialize(uint32_t colorAttachmentCount, const AttachmentDesc* colorAttachments,
const AttachmentDesc* depthStencilAttachment) {
m_colorAttachmentCount = colorAttachmentCount;
m_colorAttachments.resize(colorAttachmentCount);
for (uint32_t i = 0; i < colorAttachmentCount; ++i) {
m_colorAttachments[i] = colorAttachments[i];
}
if (depthStencilAttachment != nullptr) {
m_hasDepthStencil = true;
m_depthStencilAttachment = *depthStencilAttachment;
} else {
m_hasDepthStencil = false;
}
return true;
}
} // namespace RHI
} // namespace XCEngine