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 piston's fps_counter #176

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add piston's fps_counter #176

wants to merge 6 commits into from

Conversation

acerix
Copy link

@acerix acerix commented Jan 21, 2016

I'm trying to learn Rust, figured I would start with something small...

#37

This PR includes the fps_counter crate (from Piston developers), and displays the FPS (commented out in view_thread.rs).

Let me know if this looks good, and I'll add something to display it in the viewport, otherwise please let me know how it could be done better.

@bfops
Copy link
Owner

bfops commented Jan 23, 2016

It looks fine, but there's not really any GUI right now, so I can't think of where you'd add it?

@acerix
Copy link
Author

acerix commented Feb 2, 2016

For now, it just displays in the console (println), but I'm thinking something looking like this:

http://rawgit.com/mrdoob/stats.js/master/examples/theming.html

I noticed playform is moving from piston to glium, so I suppose the FPS display should be glium-compatible, maybe using glium-text?

@bfops
Copy link
Owner

bfops commented Feb 2, 2016

Why not just let _fps? println every frame is a lot of output.

Playform doesn't use piston; it would just be migrating to glium from straight OpenGL. I haven't looked at glium-text, or any of the 2D/GUI libraries, which might also have text support.

@acerix
Copy link
Author

acerix commented Feb 2, 2016

I didn't know about silencing the warning with an underscore, thanks!

@acerix
Copy link
Author

acerix commented Feb 2, 2016

I remember seeing some instructions displayed before (not sure if they were removed or no longer working) so the FPS could be displayed like that for now. If the graphics wrapper is going to be glium though, it seems like glium_text is a good option, it's by the same author.

I don't know why I thought playform was using piston...

@cooperra
Copy link

https://github.com/PistonDevelopers/piston/wiki/Games-Made-With-Piston links here.

@bfops
Copy link
Owner

bfops commented Feb 12, 2016

Oh good point, I'd entirely forgotten about that. I was using piston for a little while, but I was only using little things, so I moved away from it.

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.

3 participants