mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Feat] (MG_Util/Converters): Implement converters related to framebuffer enum.
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user