starting the refactoring of PGL

This commit is contained in:
codeanticode
2013-09-08 14:07:47 -04:00
parent e2b9f2f552
commit 764616c9e1
6 changed files with 875 additions and 677 deletions
@@ -1,22 +0,0 @@
package processing.lwjgl;
public class PGraphics2D extends processing.opengl.PGraphics2D {
public PGraphics2D() {
pgl = new PGL(this);
if (tessellator == null) {
tessellator = new Tessellator();
}
intBuffer = PGL.allocateIntBuffer(2);
floatBuffer = PGL.allocateFloatBuffer(2);
viewport = PGL.allocateIntBuffer(4);
inGeo = newInGeometry(IMMEDIATE);
tessGeo = newTessGeometry(IMMEDIATE);
texCache = newTexCache();
initialized = false;
}
}
@@ -1,22 +0,0 @@
package processing.lwjgl;
public class PGraphics3D extends processing.opengl.PGraphics3D {
public PGraphics3D() {
pgl = new PGL(this);
if (tessellator == null) {
tessellator = new Tessellator();
}
intBuffer = PGL.allocateIntBuffer(2);
floatBuffer = PGL.allocateFloatBuffer(2);
viewport = PGL.allocateIntBuffer(4);
inGeo = newInGeometry(IMMEDIATE);
tessGeo = newTessGeometry(IMMEDIATE);
texCache = newTexCache();
initialized = false;
}
}
@@ -22,6 +22,7 @@
package processing.lwjgl;
import processing.opengl.PGL;
import processing.opengl.PGraphicsOpenGL;
/**
@@ -29,27 +30,8 @@ import processing.opengl.PGraphicsOpenGL;
*
*/
public class PGraphicsLWJGL extends PGraphicsOpenGL {
//////////////////////////////////////////////////////////////
// INIT/ALLOCATE/FINISH
public PGraphicsLWJGL() {
pgl = new PGL(this);
if (tessellator == null) {
tessellator = new Tessellator();
}
intBuffer = PGL.allocateIntBuffer(2);
floatBuffer = PGL.allocateFloatBuffer(2);
viewport = PGL.allocateIntBuffer(4);
inGeo = newInGeometry(IMMEDIATE);
tessGeo = newTessGeometry(IMMEDIATE);
texCache = newTexCache();
initialized = false;
static public PGL createPGL(PGraphicsOpenGL pg) {
return new PLWJGL(pg);
}
}