MCPcopy Index your code
hub / github.com/processing/processing / attribImpl

Method attribImpl

core/src/processing/opengl/PShapeOpenGL.java:1161–1185  ·  view source on GitHub ↗
(String name, int kind, int type, int size)

Source from the content-addressed store, hash-verified

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

Callers 5

attribPositionMethod · 0.95
attribNormalMethod · 0.95
attribColorMethod · 0.95
attribMethod · 0.95
setAttribMethod · 0.95

Calls 4

showWarningMethod · 0.95
getMethod · 0.65
putMethod · 0.45
initAttribMethod · 0.45

Tested by

no test coverage detected