Map buffer with correct type according to attrib type

This commit is contained in:
codeanticode
2022-01-22 17:24:47 -05:00
parent afcce46ae2
commit cecf24df8c
@@ -9920,7 +9920,13 @@ public class PGraphicsOpenGL extends PGraphics {
}
protected void mapPolyAttribBuffer(VertexAttribute attrib) {
polyAttribBuffers.put(attrib.name, pg.pgl.mapBuffer(PGL.ARRAY_BUFFER, PGL.WRITE_ONLY).asFloatBuffer());
if (attrib.type == PGL.FLOAT) {
polyAttribBuffers.put(attrib.name, pg.pgl.mapBuffer(PGL.ARRAY_BUFFER, PGL.WRITE_ONLY).asFloatBuffer());
} else if (attrib.type == PGL.INT) {
polyAttribBuffers.put(attrib.name, pg.pgl.mapBuffer(PGL.ARRAY_BUFFER, PGL.WRITE_ONLY).asIntBuffer());
} else if (attrib.type == PGL.BOOL) {
polyAttribBuffers.put(attrib.name, pg.pgl.mapBuffer(PGL.ARRAY_BUFFER, PGL.WRITE_ONLY));
}
}
protected void initPolyAttribsBuffer(VertexAttribute attrib, boolean onlymap, boolean unmap, int usage) {