MCPcopy Index your code
hub / github.com/spritejs/spritejs / draw

Method draw

src/node/node.js:349–378  ·  view source on GitHub ↗
(meshes = [])

Source from the content-addressed store, hash-verified

347 }
348
349 draw(meshes = []) {
350 const mesh = this.mesh;
351
352 if(mesh) {
353 applyFilters(mesh, this.filters);
354 meshes.push(mesh);
355 if(this[_program]) {
356 mesh.setProgram(this[_program]);
357 const shaderAttrs = this[_shaderAttrs];
358 if(shaderAttrs) {
359 Object.entries(shaderAttrs).forEach(([key, setter]) => {
360 mesh.setAttribute(key, setter);
361 });
362 }
363 const uniforms = this[_uniforms];
364 if(this[_uniforms]) {
365 const _uniform = {};
366 Object.entries(uniforms).forEach(([key, value]) => {
367 if(typeof value === 'function') {
368 value = value(this, key);
369 }
370 _uniform[key] = value;
371 });
372 mesh.setUniforms(_uniform);
373 }
374 }
375 applyRenderEvent(this, mesh);
376 }
377 return meshes;
378 }
379
380 forceUpdate() {
381 if(this.parent) this.parent.forceUpdate();

Callers 4

polyfillFunction · 0.45
layer.jsFile · 0.45
group.jsFile · 0.45
renderMethod · 0.45

Calls 5

applyFiltersFunction · 0.90
setProgramMethod · 0.65
setAttributeMethod · 0.65
setUniformsMethod · 0.65
applyRenderEventFunction · 0.50

Tested by

no test coverage detected