mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
cap framerate at 1000 in OpenGL
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user