cap framerate at 1000 in OpenGL

This commit is contained in:
codeanticode
2018-02-13 02:13:45 -05:00
parent 60703b7d04
commit 54fba5da9e
+9 -2
View File
@@ -815,8 +815,15 @@ public class PSurfaceJOGL implements PSurface {
public void setFrameRate(float fps) {
if (fps < 1) {
PGraphics.showWarning("The OpenGL renderers cannot have a frame rate lower than 1.\nYour sketch will run at 1 frame per second.");
PGraphics.showWarning(
"The OpenGL renderer cannot have a frame rate lower than 1.\n" +
"Your sketch will run at 1 frame per second.");
fps = 1;
} else if (fps > 1000) {
PGraphics.showWarning(
"The OpenGL renderer cannot have a frame rate higher than 1000.\n" +
"Your sketch will run at 1000 frames per second.");
fps = 1000;
}
if (animator != null) {
animator.stop();
@@ -1220,7 +1227,7 @@ public class PSurfaceJOGL implements PSurface {
}
static Map<Integer, CursorInfo> cursors = new HashMap<>();
static Map<Integer, String> cursorNames = new HashMap<Integer, String>();
static Map<Integer, String> cursorNames = new HashMap<>();
static {
cursorNames.put(PConstants.ARROW, "arrow");
cursorNames.put(PConstants.CROSS, "cross");