转换
static GLenum CryDustFBTextureFormatToGL(FramebufferTextureFormat format)
{
switch (format)
{
case FramebufferTextureFormat::RGBA8: return GL_RGBA8;
case FramebufferTextureFormat::RED_INTEGER: return GL_RED_INTEGER;
}
CORE_DEBUG_ASSERT(false);
return 0;
}
清理
void OpenGLFramebuffer::ClearAttachment(uint32_t attachmentIndex, int value)
{
CORE_DEBUG_ASSERT(attachmentIndex < m_ColorAttachments.size());
auto& spec = m_ColorAttachmentSpecifications[attachmentIndex];
glClearTexImage(m_ColorAttachments[attachmentIndex], 0,
Utils::CryDustFBTextureFormatToGL(spec.TextureFormat), GL_INT, &value);
}