[Feat] (MG_Util/Converters): Implement converters related to framebuffer enum.

This commit is contained in:
BZLZHH
2025-10-02 22:30:17 +08:00
parent 3ba1842758
commit 87f487c3aa
7 changed files with 144 additions and 0 deletions
@@ -0,0 +1,36 @@
#include "FramebufferEnumConverter.h"
namespace MobileGL {
namespace MG_Util {
String ConvertFramebufferTargetToString(FramebufferTarget bufferTarget) {
switch (bufferTarget) {
case FramebufferTarget::Draw:
return "Draw";
case FramebufferTarget::Read:
return "Read";
case FramebufferTarget::Unknown:
default:
return "Unknown";
}
}
String ConvertFramebufferAttachmentTypeToString(FramebufferAttachmentType attachment) {
if (attachment >= FramebufferAttachmentType::Color0 && attachment <= FramebufferAttachmentType::Color31) {
return "Color" + std::to_string(static_cast<SizeT>(attachment) -
static_cast<SizeT>(FramebufferAttachmentType::Color0));
}
switch (attachment) {
case FramebufferAttachmentType::Depth:
return "Depth";
case FramebufferAttachmentType::Stencil:
return "Stencil";
case FramebufferAttachmentType::DepthStencil:
return "DepthStencil";
case FramebufferAttachmentType::Unknown:
default:
return "Unknown";
}
}
} // namespace MG_Util
} // namespace MobileGL
@@ -0,0 +1,10 @@
#pragma once
#include <Includes.h>
#include <MG_State/GLState/FramebufferState/FramebufferObject.h>
namespace MobileGL {
namespace MG_Util {
String ConvertFramebufferTargetToString(FramebufferTarget bufferTarget);
String ConvertFramebufferAttachmentTypeToString(FramebufferAttachmentType attachment);
} // namespace MG_Util
} // namespace MobileGL