Created
August 13, 2015 19:51
-
-
Save jamwaffles/4d51ca67438041b6f2ae to your computer and use it in GitHub Desktop.
Rust "class" definition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Sprite { | |
image_data: SomeBinaryType, | |
width: i16, | |
height: i16 | |
} | |
impl Sprite { | |
pub fn new(filename: str) -> Sprite { | |
// TOOD: Load image into a Piston/OpenGL texture | |
Sprite { | |
image_data: loaded_image.data, | |
width: loaded_image.width, | |
height: loaded_image.height | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment