Skip to content

Commit 8355e90

Browse files
committed
Add deltaTime field and getFrameRate() method
1 parent eca1d6b commit 8355e90

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Processing.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4211,6 +4211,7 @@ struct PApplet {
42114211

42124212
int frameCount = 1;
42134213
float _frameRate = 60.0f;
4214+
float deltaTime = 0.016f; // seconds since last frame (like p5.js deltaTime/1000)
42144215
bool looping = true;
42154216

42164217

@@ -4290,7 +4291,8 @@ struct PApplet {
42904291
void size(int w, int h, int renderer);
42914292
void fullScreen();
42924293
void fullScreen(int mode);
4293-
void frameRate(int fps);
4294+
void frameRate(int fps);
4295+
float getFrameRate() const { return _frameRate; }
42944296
void noLoop();
42954297
void loop();
42964298
void redraw();

0 commit comments

Comments
 (0)