Struct sdl2::surface::Surface[src]

pub struct Surface {
    pub raw: *SDL_Surface,
    pub owned: bool,
}

Fields

raw
owned

Methods

impl Surface

fn new(surface_flags: SurfaceFlag, width: int, height: int, bpp: int, rmask: u32, gmask: u32, bmask: u32, amask: u32) -> Result<Surface, ~str>

fn get_width(&self) -> u16

fn get_height(&self) -> u16

fn get_size(&self) -> (u16, u16)

fn get_rect(&self) -> Rect

fn get_pixel_format(&self) -> PixelFormat

fn lock(&self) -> bool

fn with_lock<R>(&self, f: |pixels: &mut [u8]| -> R) -> R

Locks a surface so that the pixels can be directly accessed safely.

fn unlock(&self)

fn from_bmp(path: &Path) -> Result<Surface, ~str>

fn save_bmp(&self, path: &Path) -> Result<(), ~str>

fn set_palette(&self, palette: &Palette) -> bool

fn enable_RLE(&self) -> bool

fn disable_RLE(&self) -> bool

fn set_color_key(&self, enable: bool, color: Color) -> Result<(), ~str>

fn get_color_key(&self) -> Result<Color, ~str>

fn set_color_mod(&self, color: Color) -> bool

fn get_color_mod(&self) -> Result<Color, ~str>

Trait Implementations

impl Drop for Surface

fn drop(&mut self)

Derived Implementations

impl Eq for Surface

fn eq(&self, __arg_0: &Surface) -> bool

fn ne(&self, __arg_0: &Surface) -> bool