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

Add draw_fps helper function #852

Merged
merged 1 commit into from
Nov 16, 2024
Merged

Add draw_fps helper function #852

merged 1 commit into from
Nov 16, 2024

Conversation

juliohq
Copy link
Contributor

@juliohq juliohq commented Oct 26, 2024

This PR adds draw_fps and draw_frame_time functions for drawing the result of get_fps and get_frame_time, respectively.

The rustaceanmark example was updated to use the newly added draw_fps function.

@not-fl3
Copy link
Owner

not-fl3 commented Oct 27, 2024

Thanks for PR!
I was thinking about draw_fps, and I think that in a shape of draw_fps(0., 16., 32., WHITE); it doesn't really provide enough value to justify an existance of a separate function. And I don't really think anyone would ever use draw_frame_time, and if they will need it - I would say its too niche of the use case for a special function.

However, draw_fps() with no arguments might be usefull for quick tests, what do you think about this?
I would add a doc-comment that draw_fps() is just a shortcut for draw_text(..) and for customization draw_text is preferable way to do it.

@juliohq
Copy link
Contributor Author

juliohq commented Oct 27, 2024

Yes, I think it makes sense to remove draw_frame_time in this case and add the doc-comment you mentioned to draw_fps.

@not-fl3
Copy link
Owner

not-fl3 commented Oct 27, 2024

I would rather have draw_fps() as a no-argument function. If custom format, position, font size of anything is required - its not that much of a problem to call draw_text I belive.

@juliohq
Copy link
Contributor Author

juliohq commented Nov 15, 2024

I would rather have draw_fps() as a no-argument function.

Sure, it should work better like that I think.

@juliohq juliohq changed the title Add draw_fps and draw_frame_time functions Add draw_fps helper function Nov 15, 2024
@not-fl3
Copy link
Owner

not-fl3 commented Nov 16, 2024

Perfect, thanks for PR!

@not-fl3 not-fl3 merged commit 5c4132b into not-fl3:master Nov 16, 2024
6 checks passed
@juliohq juliohq deleted the draw-fps branch November 16, 2024 19:40
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

Successfully merging this pull request may close these issues.

2 participants