From 9a44cb85e3cf9f5e5d242b752bb3339bced2a564 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Sat, 15 Nov 2014 17:15:03 -0700 Subject: [PATCH] implemented a few more PSurface methods --- core/src/processing/opengl/PGL.java | 4 +++- core/src/processing/opengl/PJOGL.java | 4 +++- core/src/processing/opengl/PSurfaceNEWT.java | 8 +++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index dedaeb5b6..4e87f1508 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -630,7 +630,9 @@ public abstract class PGL { private boolean needFBOLayer(boolean clear0) { // TODO: need to revise this, on windows we might not want to use FBO layer // even with anti-aliasing enabled... -// return !clear0 || fboLayerRequested || 1 < numSamples; + boolean res = !clear0 || fboLayerRequested || 1 < numSamples; +// System.err.println(res + " " + clear0 + " " + fboLayerRequested + " " + numSamples); +// return res; return false; } diff --git a/core/src/processing/opengl/PJOGL.java b/core/src/processing/opengl/PJOGL.java index 97b6d289d..dd8c709e1 100644 --- a/core/src/processing/opengl/PJOGL.java +++ b/core/src/processing/opengl/PJOGL.java @@ -802,7 +802,9 @@ public class PJOGL extends PGL { protected void getBuffers(GLWindow glWindow) { - if (USE_JOGL_FBOLAYER && capabilities.isFBO()) { + if (false) { +// if (capabilities.isFBO()) { +// if (USE_JOGL_FBOLAYER && capabilities.isFBO()) { // The onscreen drawing surface is backed by an FBO layer. GLFBODrawable fboDrawable = null; fboDrawable = (GLFBODrawable)glWindow.getDelegatedDrawable(); diff --git a/core/src/processing/opengl/PSurfaceNEWT.java b/core/src/processing/opengl/PSurfaceNEWT.java index 0a9bcdc81..dda855d04 100644 --- a/core/src/processing/opengl/PSurfaceNEWT.java +++ b/core/src/processing/opengl/PSurfaceNEWT.java @@ -127,6 +127,9 @@ public class PSurfaceNEWT implements PSurface { caps.setDepthBits(PGL.REQUESTED_DEPTH_BITS); caps.setStencilBits(PGL.REQUESTED_STENCIL_BITS); + caps.setPBuffer(false); + caps.setFBO(true); + caps.setSampleBuffers(true); caps.setNumSamples(2); caps.setBackgroundOpaque(true); @@ -309,12 +312,11 @@ public class PSurfaceNEWT implements PSurface { } public void setFrameRate(float fps) { - // TODO Auto-generated method stub - + animator.setFPS((int)fps); } public void requestFocus() { - // TODO Auto-generated method stub + window.requestFocus(); }