(String name, int kind, int type, int size)
| 1176 | |
| 1177 | |
| 1178 | protected VertexAttribute attribImpl(String name, int kind, int type, int size) { |
| 1179 | if (4 < size) { |
| 1180 | PGraphics.showWarning("Vertex attributes cannot have more than 4 values"); |
| 1181 | return null; |
| 1182 | } |
| 1183 | VertexAttribute attrib = polyAttribs.get(name); |
| 1184 | if (attrib == null) { |
| 1185 | attrib = new VertexAttribute(pg, name, kind, type, size, PGL.bufferUsageRetained); |
| 1186 | polyAttribs.put(name, attrib); |
| 1187 | inGeo.initAttrib(attrib); |
| 1188 | } |
| 1189 | if (attrib.kind != kind) { |
| 1190 | PGraphics.showWarning("The attribute kind cannot be changed after creation"); |
| 1191 | return null; |
| 1192 | } |
| 1193 | if (attrib.type != type) { |
| 1194 | PGraphics.showWarning("The attribute type cannot be changed after creation"); |
| 1195 | return null; |
| 1196 | } |
| 1197 | if (attrib.size != size) { |
| 1198 | PGraphics.showWarning("New value for vertex attribute has wrong number of values"); |
| 1199 | return null; |
| 1200 | } |
| 1201 | return attrib; |
| 1202 | } |
| 1203 | |
| 1204 | |
| 1205 | @Override |
no test coverage detected