Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The FPS_LIMIT and MS_PER_FRAME global constant are not respected. #9

Open
ghost opened this issue Aug 21, 2021 · 1 comment
Open

The FPS_LIMIT and MS_PER_FRAME global constant are not respected. #9

ghost opened this issue Aug 21, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 21, 2021

QDirect3D currently cap itself at 60 frames per second. Changes made to FPS_LIMIT and MS_PER_FRAME are discarded.

Component
QDirect3D9Widget
QDirect3D10Widget
QDirect3D11Widget
QDirect3D12Widget

@giladreich
Copy link
Owner

This one in relation to #10
Makes me question this QTimer usage. I haven't looked into these things for quite some time now, so I'll probably need more time to debug this during the weekends, but just to mention that funnily enough this was left unnoticed due to the fact of me being happy with solid 60 FPS for rendering.

In terms of the calculations from FPS to milliseconds it LGTM, since QTimer expects the argument to be in milliseconds.
What's weird however, even if I pass it the value 2, it will still render 60 FPS, which to my calculations should render on 500 FPS, but if I pass it 150, then it indeed affects the FPS and render with 6 FPS., which to my calculations should be correct, as (1 / 150) * 1000 = 6.6666.

I'm thinking maybe even a better solution would be getting rid of the QTimer usage fully, as it will allow more precise calculations of FPS and be reliable, just like how you would have a game loop where you have better control of these things. I'm not sure at this point, but thinking out loud in case you'll look into this.

Many thanks for your contributions, @wroy-ca!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant