SDL2Surface

SDL Surface wrapper. A SDL2Surface might own the SDL_Surface* handle or not.

Constructors

this
this(SDL2 sdl2, SDL_Surface* surface, Owned owned)

Create from an existing SDL_Surface* handle.

this
this(SDL2 sdl2, int width, int height, int depth, uint Rmask, uint Gmask, uint Bmask, uint Amask)

Create a new RGBA surface. Both pixels data and handle are owned.

this
this(SDL2 sdl2, void* pixels, int width, int height, int depth, int pitch, uint Rmask, uint Gmask, uint Bmask, uint Amask)

Create surface from RGBA data. Pixels data is <b>not</b> and not owned.

Destructor

~this
~this()

Releases the SDL resource.

Members

Enums

Owned
enum Owned

Whether a SDL Surface is owned by the wrapper or borrowed.

Functions

clone
SDL2Surface clone()
close
deprecated void close()
Undocumented in source. Be warned that the author may not have intended to support it.
convert
SDL2Surface convert(const(SDL_PixelFormat)* newFormat)

Converts the surface to another format.

getRGBA
RGBA getRGBA(int x, int y)

Get a surface pixel color.

handle
SDL_Surface* handle()
lock
void lock()

Lock the surface, allow to use pixels().

pitch
size_t pitch()

Get the surface pitch (number of bytes between lines).

pixelFormat
SDL_PixelFormat* pixelFormat()
pixels
ubyte* pixels()
unlock
void unlock()

Unlock the surface.

Properties

height
int height [@property getter]
width
int width [@property getter]

Structs

RGBA
struct RGBA

Variables

_handleOwned
Owned _handleOwned;
Undocumented in source.
_sdl2
SDL2 _sdl2;
Undocumented in source.
_surface
SDL_Surface* _surface;
Undocumented in source.

Meta