jeremyletang/rust-sfml — pull request #49 by brandonson (2014-08-31 08:35:18+00:00)
Title: RenderTarget trait (WIP, looking for any comments)

Based off #47 which is a minor change to let things work on windows again.

Standard SFML has a RenderTarget class/interface which unifies a lot of the operations for RenderWindow and RenderTexture. Rust-SFML just... doesn't. And there's no particular reason for that as far as I can tell. Even worse, it adds a lot of code duplication when implementing the Drawable trait. So, this is an attempt to create a working RenderTarget trait and be able to simplify Drawable to only need 1-2 functions to implement instead of the current 4.

This does require a small change to the views for RenderWindows - instead of storing them as Rc>, they're fetched from SFML the same way a RenderTexture does, and return a View.

Currently have a RenderTarget trait implemented, which is nice, but not enough to justify merging yet IMO. So, as the title says, this is a work in progress, and will hopefully have something more useful soon.

If anyone has any comments/questions, I'd be happy to hear them so I can make this as useful (and harmless!) a change as possible.