|
Size: 3311
Comment: update content (w/ Sam)
|
Size: 3553
Comment: update content - old wiki
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 12: | Line 12: |
| ||[[SDL_PixelFormat]]*||'''format'''||read-only|| ||int||'''w, h'''||read-only|| ||int||'''pitch'''||read-only|| ||void*||'''pixels'''||read-write|| |
||[[SDL_PixelFormat]]*||'''format'''||the format of the pixels stored in the surface; ,,see [[SDL_PixelFormat]],, (read-only)|| ||int||'''w, h'''||the surface width and height in pixels (read-only)|| ||int||'''pitch'''||the length of a surface scanline in bytes (read-only)|| ||void*||'''pixels'''||the pointer to the actual pixel data; the surface should be locked by [[SDL_LockSurface]]() before accessing this field (read-write)|| |
| Line 17: | Line 17: |
| ||void*||'''userdata'''||read-write|| | ||void*||'''userdata'''||,,a pointer to user-specified content???,, (read-write)|| |
| Line 22: | Line 22: |
| ||[[SDL_Rect]]||'''clip_rect'''||read-only|| | ||[[SDL_Rect]]||'''clip_rect'''||the surface clip rectangle which can be set by [[SDL_SetClipRect]]() (read-only)|| |
| Line 27: | Line 27: |
| ||<:bgcolor="#EDEDED"-3>''Reference count -- used when freeing surface''|| | ||<:bgcolor="#EDEDED"-3>'',,Reference count --,, used when freeing surface''|| |
| Line 29: | Line 29: |
| <<Color2(green,There are more descriptions in the old wiki such as "the length of a surface scanline in bytes" for '''pitch'''. Should any of those be moved here to clarify the information that this struct holds even though it's mostly read-only?)>> | |
| Line 35: | Line 34: |
<<Color2(green,Should any of the User Comments from the old wiki be included here?)>> |
DRAFT |
SDL_Surface
A structure that contains a collection of pixels used in software blitting.
Data Fields
Uint32 |
flags |
internal |
format |
the format of the pixels stored in the surface; see [[SDL_PixelFormat]] (read-only) |
|
int |
w, h |
the surface width and height in pixels (read-only) |
int |
pitch |
the length of a surface scanline in bytes (read-only) |
void* |
pixels |
the pointer to the actual pixel data; the surface should be locked by SDL_LockSurface() before accessing this field (read-write) |
Application data associated with the surface |
||
void* |
userdata |
a pointer to user-specified content??? (read-write) |
Information needed for surfaces requiring locks |
||
int |
locked |
read-only |
void* |
lock_data |
read-only |
Clipping information |
||
clip_rect |
the surface clip rectangle which can be set by SDL_SetClipRect() (read-only) |
|
Info for fast blit mapping to other surfaces |
||
SDL_BlitMap* |
map |
internal |
Format version, bumped at every change to invalidate blit maps |
||
unsigned int Uint? |
format_version |
internal |
Reference count -- used when freeing surface |
||
int |
refcount |
read-mostly |
Code Examples
You can add your code example here
green
Remarks
An SDL_Surface structure represents an area of graphical memory that can be drawn to.
This structure should be treated as read-only, except for pixels which, if not NULL, contains the raw pixel data for the surface.
Related Structures
