Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A high-performance, bindless graphics API for Rust (github.com/gfx-rs)
98 points by cjfont on Nov 15, 2014 | hide | past | favorite | 13 comments


Hey there HN! I am one of the authors of this library - if you have any questions, feel free to ask. Kvark, one of our key contributors recently did a talk at the Toronto meetup[0] (starts from ~53:00) discussing some of the design of the API.

Bear in mind that the API still could use more work, and could be documented better, but it is already pretty promising. We currently only support OpenGL as a back-end, but hope to support more APIs in the future. This support is currently blocked on a some language features being fully implemented.

The biggest project built using gfx-rs to date is hematite[1] - a re-implementation of Minecraft. Colin Sherratt is also doing some neat work with it in his engine, snowmew[2], which is more graphics intensive.

If you are interested in having a chat with us, feel free to hop on our gitter room[1] or #rust-gamedev (irc.mozilla.org).

- [0]: https://air.mozilla.org/toronto-rust-meetup-october-2014/

- [1]: https://github.com/PistonDevelopers/hematite

- [2]: https://github.com/csherratt/snowmew/

- [3]: https://gitter.im/gfx-rs/gfx-rs


Can you tell us a bit more about the history of the project ? Are you a game developer ? Why did you put so much work in such a huge project ? (thanks for that ! That's wonderful)


> Can you tell us a bit more about the history of the project?

I wrote an outline of my wishes for a graphics API in a README at the end of last year, then pushed it to an empty Github repo. Nothing really happened for eight months as I worked on other projects in the Rust ecosystem. Out of the blue kvark contacted me wishing to collaborate. He has similar gripes to me with respect to graphics APIs, but unlike me he has had a large amount of experience in professional game development. It is thanks to him that we are where we are today.

We still have a long way to go towards making gfx-rs a polished and production ready. A great deal of the ugliness stems from us lacking a few key language features. Thankfully those are slated to be finished by Rust 1.0, so things will get better soon!

> Are you a game developer?

No, I'm a CS student who is interested in computer graphics and procedural generation. I come from an art and illustration background and my original goal for Rust was to generate my art[0] algorithmically in real-time. Unfortunately most of my time over the last couple of years has been spent helping to build up the Rust ecosystem to a stage where it is a viable choice for game developers.

> Why did you put so much work in such a huge project?

I could sit around battling with clunky tools like C++, but if everyone did that then nothing would change. Instead I have chosen to sacrifice some of my 'project time' towards helping to make Rust look like a viable choice for my peers. I may struggle to ever finish my actual project, but if I can help other people create wonderful stuff in the future then I will consider my time well spent.

- [0]: http://voyager3.tumblr.com/


> Unfortunately most of my time over the last couple of years has been spent helping to build up the Rust ecosystem to a stage where it is a viable choice for game developers.

Unfortunate for you, but fortunate for a great many other people. Thank you for doing this.


No worries! I'm glad to be of service. At any rate, my work has certainly helped me land a couple of sweet internships. Doing work on interesting projects always looks good on your resume. :)


I would also recommend checking out tomaka's glium[0] wrapper for OpenGL. It takes a different tack when it comes to providing a thin, statically typed graphics API, so depending on your preferences it might be more your cup of tea.

- [0]: https://github.com/tomaka/glium


Another gfx-rs contributor here. It still has a long way to go, but we've made some solid progress, but some in-progress language changes will enable to next iteration of our API, with a lot of simplification to our public interface. It's still a WIP!


What language changes are you waiting for?



Anyone know a nice Rust audio library to go with this? Should we be wrapping PortAudio or something?


http://rust-ci.org/projects/#audio Here's a list of audio libraries which have travis integration. This includes bindings to SDL_mixer, portaudio, OpenAL, alsa and libao.


I'm not sure. There might be something on PistonDevelopers: https://github.com/PistonDevelopers/

Bear in mind, the Rust library ecosystem is still pretty young, so you might have to write your own. Some could say that's a problem, but to me it's exciting. If you build a strong, foundational library you have the chance to make a much bigger impact in the long run than if you invest your time in an old, established language like C++.


I know no specifics, but the gamedev wiki page[1] lists a few, and you can definitely ask on #rust-gamedev on irc.mozilla.org or even the rust_gamedev subreddit.

[1]: https://github.com/rust-lang/rust/wiki/Computer-Graphics-and...

[2]: http://www.reddit.com/r/rust_gamedev




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: