[Feat] (All): Continue building the basic structure.

Feat: implement MG_Impl/VertexArray
Feat: add tests about MG_Impl/VertexArray
Feat: add several converters
Feat: implement IsBuffer
This commit is contained in:
BZLZHH
2025-07-25 21:36:14 +08:00
parent e7a21423da
commit 47f7039720
18 changed files with 672 additions and 12 deletions
@@ -384,6 +384,13 @@ namespace MobileGL {
auto& bindingSlot = MG_State::pGLContext->GetBufferBindingSlot(bufferTarget);
bindingSlot.Bind(bufferObject);
if (bufferTarget == BufferTarget::Index) {
auto currentVAO = MG_State::pGLContext->GetBoundVertexArray();
if (currentVAO) {
currentVAO->BindElementBuffer(bufferObject);
}
}
}
void GenBuffers_State(GLsizei n, GLuint* buffers) {
@@ -396,7 +403,23 @@ namespace MobileGL {
Copy(bufferNames.data(), buffers, bufferNames.size());
}
GLboolean IsBuffer_State(GLuint buffer) {
if (buffer == 0) {
MG_State::pGLContext->RecordError(ErrorCode::InvalidValue,
MakeShared<GenericErrorInfo>("MG_Impl/GLImpl", "IsBuffer_State",
"Buffer name 0 is not a valid buffer object."));
return GL_FALSE;
}
if (!BufferImpl::ValidateBufferName(buffer)) return GL_FALSE;
return MG_State::pGLContext->ValidateBufferObject(buffer) ? GL_TRUE : GL_FALSE;
}
/* @INSERTION_POINT:FUNCTION_IMPLEMENTATION@ */
GLboolean IsBuffer(GLuint buffer) {
return IsBuffer_State(buffer);
}
void DeleteBuffers(GLsizei n, const GLuint* buffers) {
DeleteBuffers_State(n, buffers);
}