Struct sdl2::surface::SurfaceRef [] [src]

pub struct SurfaceRef { /* fields omitted */ }

An unsized Surface reference.

This type is used whenever Surfaces need to be borrowed from the SDL library, without concern for freeing the Surface.

Methods

impl SurfaceRef
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

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

[src]

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

[src]

Returns the Surface's pixel buffer if the Surface doesn't require locking (e.g. it's a software surface).

[src]

Returns the Surface's pixel buffer if the Surface doesn't require locking (e.g. it's a software surface).

[src]

Returns true if the Surface needs to be locked before accessing the Surface pixels.

[src]

[src]

[src]

[src]

[src]

[src]

[src]

The function will fail if the surface doesn't have color key enabled.

[src]

[src]

[src]

[src]

[src]

[src]

[src]

The function will fail if the blend mode is not supported by SDL.

[src]

[src]

Sets the clip rectangle for the surface.

If the rectangle is None, clipping will be disabled.

[src]

Gets the clip rectangle for the surface.

Returns None if clipping is disabled.

[src]

Copies the surface into a new one that is optimized for blitting to a surface of a specified pixel format.

[src]

Performs surface blitting (surface copying).

Returns the final blit rectangle, if a dst_rect was provided.

[src]

Performs low-level surface blitting.

Unless you know what you're doing, use blit() instead, which will clip the input rectangles. This function could crash if the rectangles aren't pre-clipped to the surface, and is therefore unsafe.

[src]

Performs scaled surface bliting (surface copying).

Returns the final blit rectangle, if a dst_rect was provided.

[src]

Performs low-level scaled surface blitting.

Unless you know what you're doing, use blit_scaled() instead, which will clip the input rectangles. This function could crash if the rectangles aren't pre-clipped to the surface, and is therefore unsafe.

Trait Implementations

impl AsRef<SurfaceRef> for SurfaceRef
[src]

[src]

Performs the conversion.

impl AsRef<SurfaceRef> for SurfaceRef
[src]

[src]

Performs the conversion.

impl<'a> AsRef<SurfaceRef> for Surface<'a>
[src]

[src]

Performs the conversion.

impl<'a> AsMut<SurfaceRef> for Surface<'a>
[src]

[src]

Performs the conversion.