Closed TheRealNOIG closed 4 years ago
Same thing here, is this a good candidate for either a public or protected property instead of an exposed field?
I don't remember what I was using this for but looking at the changes I think setting offset
to private should be fine because there is already a exposed variable Offset
. Than we can set offsetInBytes
to readonly. As for allowIntAsElementType
I don't remember but looking through the comments my guess is that the child class would need to read and write access.
Let me know if these changes sound good to you.
It doesn't look like you ever edited allowIntAsElementType
, at least not in the commits for this PR. Is that modification really needed? I think it might even be worth pulling all that code out in a future commit/PR since it really shouldn't be supported (even if it works in practice). offsetInBytes
as read-only sounds fine to me.
Ok I did a real fast search over one of my projects that I think was the reason this PR was made.
foreach (KeyValuePair<GenericVAO, List<ModelEntity>> item in entityDictionary)
{
GenericVAO model = item.Key;
PrepareModel(model);
foreach (Entity entity in item.Value)
{
shader.LoadTransformationMatrix(Maths.CreateTransformationMatrix(entity));
Gl.DrawElements(model.DrawMode, model.VertexCount, model.elementType, model.offsetInBytes);
}
UnBindModel();
}
Because of this, it looks like it should be fine to set offsetInBytes
and elementType
to readonly
Ran into "System.TypeAccessException" error when creating costume VAO's