[Feat] (MG_State/VertexArrayState): Add IsInteger in attribute.

This commit is contained in:
BZLZHH
2025-07-25 19:28:40 +08:00
parent 17bd9801e0
commit e7a21423da
3 changed files with 11 additions and 9 deletions
@@ -31,7 +31,7 @@ namespace MobileGL {
}
void VertexArrayObject::SetAttributeFormat(Uint index, int size, DataType type,
bool normalized, int stride, SizeT offset) {
bool normalized, int stride, SizeT offset, bool isInteger) {
if (index >= MAX_VERTEX_ATTRIBS) return;
if (size < 1 || size > 4) {
@@ -44,6 +44,7 @@ namespace MobileGL {
attr.Normalized = normalized;
attr.Stride = stride;
attr.Offset = offset;
attr.IsInteger = isInteger;
}
void VertexArrayObject::BindAttributeBuffer(Uint index,
@@ -10,6 +10,7 @@ namespace MobileGL {
bool Normalized = false;
int Stride = 0;
SizeT Offset = 0;
bool IsInteger = false;
SharedPtr<BufferObject> Buffer;
};
@@ -23,7 +24,7 @@ namespace MobileGL {
void DisableAttribute(Uint index);
bool IsAttributeEnabled(Uint index) const;
void SetAttributeFormat(Uint index, int size, DataType type, bool normalized, int stride, SizeT offset);
void SetAttributeFormat(Uint index, int size, DataType type, bool normalized, int stride, SizeT offset, bool isInteger);
void BindAttributeBuffer(Uint index, const SharedPtr<BufferObject>& buffer);