(String name, int kind, int type, int size)
| 1159 | |
| 1160 | |
| 1161 | protected VertexAttribute attribImpl(String name, int kind, int type, int size) { |
| 1162 | if (4 < size) { |
| 1163 | PGraphics.showWarning("Vertex attributes cannot have more than 4 values"); |
| 1164 | return null; |
| 1165 | } |
| 1166 | VertexAttribute attrib = polyAttribs.get(name); |
| 1167 | if (attrib == null) { |
| 1168 | attrib = new VertexAttribute(pg, name, kind, type, size); |
| 1169 | polyAttribs.put(name, attrib); |
| 1170 | inGeo.initAttrib(attrib); |
| 1171 | } |
| 1172 | if (attrib.kind != kind) { |
| 1173 | PGraphics.showWarning("The attribute kind cannot be changed after creation"); |
| 1174 | return null; |
| 1175 | } |
| 1176 | if (attrib.type != type) { |
| 1177 | PGraphics.showWarning("The attribute type cannot be changed after creation"); |
| 1178 | return null; |
| 1179 | } |
| 1180 | if (attrib.size != size) { |
| 1181 | PGraphics.showWarning("New value for vertex attribute has wrong number of values"); |
| 1182 | return null; |
| 1183 | } |
| 1184 | return attrib; |
| 1185 | } |
| 1186 | |
| 1187 | |
| 1188 | @Override |
no test coverage detected