removed PGL.update(), and updatePrimary, updateOffscreen() in

PGraphicsOpenGL.
This commit is contained in:
codeanticode
2013-05-28 14:44:22 -04:00
parent 93ee78c600
commit be83796795
2 changed files with 6 additions and 24 deletions

View File

@@ -295,6 +295,7 @@ public class PGL {
///////////////////////////////////////////////////////////
// FBO layer
protected static boolean fboLayerRequested = false;
protected static boolean fboLayerCreated = false;
protected static boolean fboLayerInUse = false;
@@ -588,19 +589,6 @@ public class PGL {
}
protected void update() {
if (!setFps) setFps(targetFps);
if (fboLayerRequested && !fboLayerCreated && !USE_JOGL_FBOLAYER) {
createFBOLayer();
}
// if (USE_JOGL_FBOLAYER) return;
// if (!fboLayerCreated) {
// createFBOLayer();
// }
}
protected int getReadFramebuffer() {
if (fboLayerInUse) {
return glColorFbo.get(0);
@@ -993,9 +981,13 @@ public class PGL {
protected void beginDraw(boolean clear0) {
if (!setFps) setFps(targetFps);
if (USE_JOGL_FBOLAYER) return;
if (needFBOLayer(clear0)) {
if (!fboLayerCreated) createFBOLayer();
bindFramebuffer(FRAMEBUFFER, glColorFbo.get(0));
framebufferTexture2D(FRAMEBUFFER, COLOR_ATTACHMENT0,
TEXTURE_2D, glColorTex.get(backTex), 0);

View File

@@ -5852,13 +5852,7 @@ public class PGraphicsOpenGL extends PGraphics {
}
protected void updatePrimary() {
pgl.update();
}
protected void beginOnscreenDraw() {
updatePrimary();
pgl.beginDraw(clearColorBuffer);
if (drawFramebuffer == null) {
@@ -5939,7 +5933,7 @@ public class PGraphicsOpenGL extends PGraphics {
}
protected void updateOffscreen() {
protected void beginOffscreenDraw() {
if (!initialized) {
initOffscreen();
} else {
@@ -5964,11 +5958,7 @@ public class PGraphicsOpenGL extends PGraphics {
} else {
setFramebuffer(offscreenFramebuffer);
}
}
protected void beginOffscreenDraw() {
updateOffscreen();
// Render previous back texture (now is the front) as background
drawPTexture();