frameRate() below 1 fails for P2D & P3D #4716

Closed
GoToLoop opened this Issue Oct 26, 2016 · 6 comments

Comments

Projects
None yet
3 participants
@GoToLoop
void setup() {
  //size(800, 600, JAVA2D); // JAVA2D works w/ below 0 frameRate().
  //size(800, 600, FX2D); // FX2D works w/ below 0 frameRate().
  size(800, 600, P2D); // P2D doesn't work w/ below 0 frameRate()!!!
  //size(800, 600, P3D); // P3D doesn't work w/ below 0 frameRate()!!!

  frameRate(.5); // below zero argument.
}

void draw() {
  background((color) random(#000000));
}

@GoToLoop GoToLoop changed the title from frameRate() below 0 fails for P2D & P3D renderers! to frameRate() below 0 fails for P2D & P3D renderers under P3! Oct 26, 2016

@GoToLoop GoToLoop changed the title from frameRate() below 0 fails for P2D & P3D renderers under P3! to frameRate() below 0 fails for P2D & P3D under P3! Oct 26, 2016

@benfry benfry added the opengl label Oct 29, 2016

@benfry benfry changed the title from frameRate() below 0 fails for P2D & P3D under P3! to frameRate() below 1 fails for P2D & P3D Oct 29, 2016

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Oct 30, 2016

Member

This is due to a limitation in JOGL's FPSAnimator, which we are currently using to drive the rendering loop in the OpenGL renderer and only accepts an integer fps. We would need to file an upstream issue with JOGL or consider other alternatives for controlling the framerate.

Member

codeanticode commented Oct 30, 2016

This is due to a limitation in JOGL's FPSAnimator, which we are currently using to drive the rendering loop in the OpenGL renderer and only accepts an integer fps. We would need to file an upstream issue with JOGL or consider other alternatives for controlling the framerate.

@GoToLoop

This comment has been minimized.

Show comment
Hide comment
@GoToLoop

GoToLoop Oct 30, 2016

Oh, I got it! But I thought FPS was based on some delta calculated within handleDraw() or something.

GoToLoop commented Oct 30, 2016

Oh, I got it! But I thought FPS was based on some delta calculated within handleDraw() or something.

@GoToLoop

This comment has been minimized.

Show comment
Hide comment
@GoToLoop

GoToLoop Oct 30, 2016

Dunno why "under P3" was removed from the title, since it implies it WORKS under P2!
On 2nd thought, why would it work for all renderers under P2 but fail under P3?
Clearly the approach used under P2 was compatible fro all renderers, no matter whether they were OpenGL-based or not.

Dunno why "under P3" was removed from the title, since it implies it WORKS under P2!
On 2nd thought, why would it work for all renderers under P2 but fail under P3?
Clearly the approach used under P2 was compatible fro all renderers, no matter whether they were OpenGL-based or not.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Oct 30, 2016

Member

@codeanticode Can you just have it return an error or warning in that case? Probably capping the minimum rate at 1 and using showWarning() when it's lower would be the right approach. (Rather than halting the sketch with an error in that case.)

Member

benfry commented Oct 30, 2016

@codeanticode Can you just have it return an error or warning in that case? Probably capping the minimum rate at 1 and using showWarning() when it's lower would be the right approach. (Rather than halting the sketch with an error in that case.)

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Nov 4, 2016

Member

Ok, done in 2a77ed8

Member

codeanticode commented Nov 4, 2016

Ok, done in 2a77ed8

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Nov 4, 2016

Member

Cool, thanks.

Member

benfry commented Nov 4, 2016

Cool, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment