# SDL_Surface

A software (CPU) image in memory. Freed when references vanish. Typically converted
to SDL_Texture for drawing, or used as raw pixel data.


### blit(dstRect, srcSurface, srcRect) <sub>function</sub>

Blit (copy) another surface onto this surface, scaling if needed.



**dstRect**: Destination {x, y, w, h}

**srcSurface**: The source SDL_Surface

**srcRect**: {x, y, w, h} portion from source


**Returns**: None


### scale(newSize) <sub>function</sub>

Return a new SDL_Surface scaled to [width, height] using linear filtering.



**newSize**: [width, height]


**Returns**: A new SDL_Surface with the scaled result.


### fill(color) <sub>function</sub>

Fill the entire surface with a single color.



**color**: [r, g, b, a] in 0..1


**Returns**: None


### rect(rect, color) <sub>function</sub>

Fill a sub-rectangle of the surface with a color.



**rect**: {x, y, w, h}

**color**: [r, g, b, a]


**Returns**: None


### dup() <sub>function</sub>

Make a copy of this surface in RGBA format.



**Returns**: A new SDL_Surface copy.

