void IParticleProcessor.DrawCallback(DrawState state, IParticleSystemDrawer particleDrawer, uint particleCount) { if (particleCount > 0) { particleDrawer.DrawCpuParticles(state, this.particleTypeData, particleCount, this.positions, this.velocity, this.colours, this.userdata); } }
//a display class wants to draw the particle system void IParticleProcessor.DrawCallback(DrawState state, IParticleSystemDrawer drawer, uint particleCount) { if (particleCount == 0) { return; } Texture2D positionTex, velocityTex, colourTex, userValues; //get the most recent textures this time GetDisplayTextures(out positionTex, out velocityTex, out colourTex, out userValues); if (positionTex != null) { drawer.DrawGpuParticles(state, this.particleTypeData, particleCount, positionTex, velocityTex, colourTex, userValues); } }
//call made by a particle drawer internal void DrawCallback(DrawState state, IParticleSystemDrawer particleDrawer) { if (systemLogic == null) throw new InvalidOperationException("Attempting to draw a ParticleSystem with unassigned ParticleSystemData Content"); if (disposed) return; this.drawProc.MarkAsDrawn(); //loop all the particle stores, and draw them all foreach (ParticleStore store in this.particleStore) store.ParticleProcessor.DrawCallback(state, particleDrawer, store.Count); }
void IParticleProcessor.DrawCallback(DrawState state, IParticleSystemDrawer particleDrawer, uint particleCount) { if (particleCount > 0) particleDrawer.DrawCpuParticles(state, this.particleTypeData, particleCount, this.positions, this.velocity, this.colours, this.userdata); }