mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +09:00
[Feat] (MG_Impl/Framebuffer): implement glDrawBuffer
This commit is contained in:
@@ -234,7 +234,7 @@ namespace MobileGL {
|
||||
MG_State::pGLContext->RecordError(
|
||||
ErrorCode::InvalidEnum,
|
||||
MakeShared<GenericErrorInfo>("MG_Impl/GLImpl", __func__,
|
||||
std::format("bufs[{}] = %s is not an accepted value.", i,
|
||||
std::format("bufs[{}] = {} is not an accepted value.", i,
|
||||
MG_Util::ConvertGLEnumToString(bufs[i]))));
|
||||
return;
|
||||
}
|
||||
@@ -294,6 +294,15 @@ namespace MobileGL {
|
||||
}
|
||||
}
|
||||
|
||||
void DrawBuffer_State(GLenum buf) {
|
||||
if (buf == GL_NONE) {
|
||||
DrawBuffers_State(0, nullptr);
|
||||
} else {
|
||||
static GLenum bufs[] = {buf};
|
||||
DrawBuffers_State(1, bufs);
|
||||
}
|
||||
}
|
||||
|
||||
void DeleteRenderbuffers_State(GLsizei n, const GLuint* renderbuffers) {
|
||||
if (n < 0) {
|
||||
MG_State::pGLContext->RecordError(
|
||||
@@ -449,7 +458,7 @@ namespace MobileGL {
|
||||
ErrorCode::InvalidEnum,
|
||||
MakeShared<GenericErrorInfo>(
|
||||
"MG_Impl/GLImpl", "GetRenderbufferParameteriv_State",
|
||||
std::format("pname %s is not an accepted value.", MG_Util::ConvertGLEnumToString(pname))));
|
||||
std::format("pname {} is not an accepted value.", MG_Util::ConvertGLEnumToString(pname))));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -557,6 +566,10 @@ namespace MobileGL {
|
||||
FramebufferRenderbuffer_State(target, attachment, renderbuffertarget, renderbuffer);
|
||||
}
|
||||
|
||||
void DrawBuffer(GLenum buf) {
|
||||
DrawBuffer_State(buf);
|
||||
}
|
||||
|
||||
void DrawBuffers(GLsizei n, const GLenum* bufs) {
|
||||
DrawBuffers_State(n, bufs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user