[][src]Struct ndless_sdl::video::Surface

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

Fields

raw: *mut SDL_Surfaceowned: bool

Methods

impl Surface[src]

pub fn new(
    surface_flags: &[SurfaceFlag],
    width: isize,
    height: isize,
    bpp: isize,
    rmask: u32,
    gmask: u32,
    bmask: u32,
    amask: u32
) -> Result<Surface, String>
[src]

pub fn from_bmp(
    path: impl Into<String>
) -> Result<Surface, String>
[src]

pub fn get_width(&self) -> u16[src]

pub fn get_height(&self) -> u16[src]

pub fn get_size(&self) -> (u16, u16)[src]

pub fn get_rect(&self) -> Rect[src]

pub fn update_rect(&self, rect: &Rect)[src]

pub fn update_rects(&self, rects: &[Rect])[src]

pub fn set_colors(&self, colors: &[Color]) -> bool[src]

pub fn set_palette(&self, palettes: &[PaletteType], colors: &[Color]) -> bool[src]

pub fn lock(&self) -> bool[src]

pub fn with_lock<F: Fn(&mut [u8]) -> bool>(&self, f: F) -> bool[src]

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

pub fn unlock(&self)[src]

pub fn flip(&self) -> bool[src]

pub fn convert(
    &self,
    fmt: &PixelFormat,
    flags: &[SurfaceFlag]
) -> Result<Surface, String>
[src]

pub fn display_format(&self) -> Result<Surface, String>[src]

pub fn display_format_alpha(&self) -> Result<Surface, String>[src]

pub fn save_bmp(
    &self,
    path: impl Into<String>
) -> bool
[src]

pub fn set_alpha(&self, flags: &[SurfaceFlag], alpha: u8) -> bool[src]

pub fn set_color_key(&self, flags: &[SurfaceFlag], color: Color) -> bool[src]

pub fn set_clip_rect(&self, rect: &Rect)[src]

pub fn get_clip_rect(&self) -> Rect[src]

pub fn blit_rect(
    &self,
    src: &Surface,
    src_rect: Option<Rect>,
    dest_rect: Option<Rect>
) -> bool
[src]

pub fn blit(&self, src: &Surface) -> bool[src]

pub fn blit_at(&self, src: &Surface, x: i16, y: i16) -> bool[src]

pub fn fill_rect(&self, rect: Option<Rect>, color: Color) -> bool[src]

pub fn fill(&self, color: Color) -> bool[src]

pub fn clear(&self) -> bool[src]

pub fn draw_str(
    &self,
    font: &Font,
    msg: impl Into<String>,
    x: i32,
    y: i32
)
[src]

Trait Implementations

impl PartialEq<Surface> for Surface[src]

impl Drop for Surface[src]

Auto Trait Implementations

impl !Send for Surface

impl !Sync for Surface

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]