brson/rust-sdl — pull request #17 by AngryLawyer (2012-12-23 15:05:41+00:00)
Title: Initial pop at High level bindings

Hi there @brson.

I'm doing this as a pull request rather than just jumping in and merging it as I'm not too comfortable with big changes going into things without at least a casual glance to make sure I've not done anything really silly.

A quick run-down of the changes:

* All the low-level bits now live in ll.rs. I've tried to make the type names, functions etc match those in the headers as much as possible.
* I've tried to avoid exposing things in ll.rs as much as possible.
* Surface is the only thing to change in the large. It now is a struct that owns the pointer to the low level surface, and should (assuming I didn't go wrong) release once it falls out of scope. There may be issues when changing window size, though, but I'll test that out and find a fix if it turns out a problem.
* Anything that could return ptr::null() from the dark depths of SDL will now return a result type, because people shouldn't have to deal with nulls, fixing issue #16.
* Except in the case of Surfaces, where there's specific owned resources to release after stuff's finished, I've tried to keep the low-level feel of the original bindings, as I'd rather engines and the like be built on these, rather than this all be used out of the box.

If I've done anything super wrong, let me know, as much of this code was written in a frenzy caused by too much tea.

Have a happy holiday season!