4040import com .thomasdiewald .liquidfun .java .render .DwJoint ;
4141import com .thomasdiewald .liquidfun .java .render .DwParticleRender ;
4242import com .thomasdiewald .liquidfun .java .render .DwParticleRenderGL ;
43+ import com .thomasdiewald .liquidfun .java .render .DwParticleRenderP5 ;
44+
4345import processing .core .PApplet ;
4446import processing .core .PGraphics ;
4547import processing .core .PShape ;
@@ -67,6 +69,12 @@ public class DwWorld extends World{
6769 public PApplet papplet ;
6870 public DwViewportTransform transform ;
6971
72+ /**
73+ * if true, particles is an instance of {@link DwParticleRenderGL}
74+ * otheriwse {@link DwParticleRenderP5} is instantiated.
75+ */
76+ static public boolean INIT_GL_PARTICLES = true ;
77+
7078
7179 public DwDebugDraw debug_draw ;
7280
@@ -91,6 +99,8 @@ public DwWorld(PApplet papplet){
9199 this (papplet , 20 );
92100 }
93101
102+
103+
94104 public DwWorld (PApplet papplet , float scale ){
95105 super (new Vec2 (0 , -10f ));
96106
@@ -115,7 +125,12 @@ public DwWorld(PApplet papplet, float scale){
115125
116126
117127 bodies = new DwBodyGroup (papplet , this , transform );
118- particles = new DwParticleRenderGL (papplet , this , transform );
128+
129+ if (INIT_GL_PARTICLES ){
130+ particles = new DwParticleRenderGL (papplet , this , transform );
131+ } else {
132+ particles = new DwParticleRenderP5 (papplet , this , transform );
133+ }
119134
120135 for (int i = 0 ; i < registered_methods .length ; i ++){
121136 papplet .registerMethod (registered_methods [i ], this );
0 commit comments