From 3af8680a7a45dde7ae9a4e5d2ffb115d8030d796 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Sun, 16 Nov 2014 18:41:26 -0700 Subject: [PATCH] disables v-sync when setting framerate to more than 60fps --- core/src/processing/opengl/PJOGL.java | 6 +++--- core/src/processing/opengl/PSurfaceNEWT.java | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core/src/processing/opengl/PJOGL.java b/core/src/processing/opengl/PJOGL.java index a9005b73b..3393d9d6e 100644 --- a/core/src/processing/opengl/PJOGL.java +++ b/core/src/processing/opengl/PJOGL.java @@ -143,7 +143,7 @@ public class PJOGL extends PGL { protected GL2GL3 gl3; /** GL2 desktop functionality (blit framebuffer, map buffer range, - * multisampled renerbuffers) */ + * multisampled renderbuffers) */ protected GL2 gl2x; /** The AWT-OpenGL canvas */ @@ -226,9 +226,9 @@ public class PJOGL extends PGL { public Canvas getCanvas() { return canvas; } +*/ - @Override protected void setFps(float fps) { if (!setFps || targetFps != fps) { if (60 < fps) { @@ -243,7 +243,7 @@ public class PJOGL extends PGL { setFps = true; } } -*/ + /* @Override diff --git a/core/src/processing/opengl/PSurfaceNEWT.java b/core/src/processing/opengl/PSurfaceNEWT.java index 013aed09e..220e29c22 100644 --- a/core/src/processing/opengl/PSurfaceNEWT.java +++ b/core/src/processing/opengl/PSurfaceNEWT.java @@ -417,7 +417,12 @@ public class PSurfaceNEWT implements PSurface { } public void setFrameRate(float fps) { - animator.setFPS((int)fps); + if (animator != null) { + animator.stop(); + animator.setFPS((int)fps); + pgl.setFps(fps); + animator.start(); + } } public void requestFocus() {