mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-10 05:08:31 +09:00
[Feat] (GL_State/Buffer, GL_Impl/Buffer): implement glBindBufferRange
This commit is contained in:
@@ -506,6 +506,22 @@ namespace MobileGL {
|
||||
|
||||
auto& point = MG_State::pGLContext->GetBufferBindingPoint(bufferTarget, index);
|
||||
point.Bind(bufferObject);
|
||||
point.ClearRange();
|
||||
}
|
||||
|
||||
void BindBufferRange_State(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {
|
||||
BufferTarget bufferTarget = MG_Util::ConvertGLEnumToBufferTarget(target);
|
||||
if (!BufferImpl::ValidateBufferBindingPointTarget(bufferTarget)) return;
|
||||
|
||||
auto bufferObject = MG_State::pGLContext->GetBufferObject(buffer);
|
||||
if (!bufferObject) {
|
||||
MG_State::pGLContext->CreateBufferObject(buffer);
|
||||
bufferObject = MG_State::pGLContext->GetBufferObject(buffer);
|
||||
}
|
||||
|
||||
auto& point = MG_State::pGLContext->GetBufferBindingPoint(bufferTarget, index);
|
||||
point.Bind(bufferObject);
|
||||
point.SetRange(Range1D(offset, offset + size));
|
||||
}
|
||||
|
||||
/* @INSERTION_POINT:FUNCTION_IMPLEMENTATION@ */
|
||||
@@ -561,5 +577,9 @@ namespace MobileGL {
|
||||
void BindBufferBase(GLenum target, GLuint index, GLuint buffer) {
|
||||
BindBufferBase_State(target, index, buffer);
|
||||
}
|
||||
|
||||
void BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {
|
||||
BindBufferRange_State(target, index, buffer, offset, size);
|
||||
}
|
||||
} // namespace MG_Impl::GLImpl
|
||||
} // namespace MobileGL
|
||||
|
||||
Reference in New Issue
Block a user