|
⇤ ← Revision 1 as of 2011-03-13 20:18:22
Size: 1269
Comment: create page - 3/13 e20c93bc9122 (2/21 16877f74123c)
|
← Revision 2 as of 2013-08-08 21:02:27 ⇥
Size: 1188
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| ||<tablewidth="100%" style="color: #FF0000;" :> DRAFT|| | |
| Line 6: | Line 5: |
| Use this function to create a new surface of the specified format, and then copy and map the given surface to it so the blit of the converted surface will be as fast as possible. | Use this function to copy an existing surface to a new surface of the specified format. |
| Line 19: | Line 18: |
| ||'''pixel_format'''||one of the [[SDL_PixelFormatEnum]] values|| ||'''flags'''||the flags are unused and should be set to 0 ???|| |
||'''pixel_format'''||one of the enumerated values in [[SDL_PixelFormatEnum]]; see [[#format|Remarks]] for details|| ||'''flags'''||the flags are unused and should be set to 0|| |
| Line 31: | Line 30: |
| ''You can add useful comments here'' <<Color2(green,Should the SDL_PixelFormatEnum values be included here?)>> |
<<Anchor(format)>> '''format''' may be one of the following: <<Include(SDL_PixelFormatEnum, , , from="=== Pixel Format Values ===", to="== Code Examples ==")>> |
| Line 36: | Line 34: |
| .[[SDL_AllocFormat]] ??? |
SDL_ConvertSurfaceFormat
Use this function to copy an existing surface to a new surface of the specified format.
Contents
Syntax
SDL_Surface* SDL_ConvertSurfaceFormat(SDL_Surface* src,
Uint32 pixel_format,
Uint32 flags)
Function Parameters
src |
the SDL_Surface structure representing the surface to convert |
pixel_format |
one of the enumerated values in SDL_PixelFormatEnum; see Remarks for details |
flags |
the flags are unused and should be set to 0 |
Return Value
Returns the new surface, or NULL on failure; call SDL_GetError() for more information.
Code Examples
You can add your code example here
Remarks
format may be one of the following:
SDL_PIXELFORMAT_UNKNOWN |
|
SDL_PIXELFORMAT_INDEX1LSB |
|
SDL_PIXELFORMAT_INDEX1MSB |
|
SDL_PIXELFORMAT_INDEX4LSB |
|
SDL_PIXELFORMAT_INDEX4MSB |
|
SDL_PIXELFORMAT_INDEX8 |
|
SDL_PIXELFORMAT_RGB332 |
|
SDL_PIXELFORMAT_RGB444 |
|
SDL_PIXELFORMAT_RGB555 |
|
SDL_PIXELFORMAT_BGR555 |
|
SDL_PIXELFORMAT_ARGB4444 |
|
SDL_PIXELFORMAT_RGBA4444 |
|
SDL_PIXELFORMAT_ABGR4444 |
|
SDL_PIXELFORMAT_BGRA4444 |
|
SDL_PIXELFORMAT_ARGB1555 |
|
SDL_PIXELFORMAT_RGBA5551 |
|
SDL_PIXELFORMAT_ABGR1555 |
|
SDL_PIXELFORMAT_BGRA5551 |
|
SDL_PIXELFORMAT_RGB565 |
|
SDL_PIXELFORMAT_BGR565 |
|
SDL_PIXELFORMAT_RGB24 |
|
SDL_PIXELFORMAT_BGR24 |
|
SDL_PIXELFORMAT_RGB888 |
|
SDL_PIXELFORMAT_RGBX8888 |
|
SDL_PIXELFORMAT_BGR888 |
|
SDL_PIXELFORMAT_BGRX8888 |
|
SDL_PIXELFORMAT_ARGB8888 |
|
SDL_PIXELFORMAT_RGBA8888 |
|
SDL_PIXELFORMAT_ABGR8888 |
|
SDL_PIXELFORMAT_BGRA8888 |
|
SDL_PIXELFORMAT_ARGB2101010 |
|
SDL_PIXELFORMAT_RGBA32 |
alias for RGBA byte array of color data, for the current platform (>= SDL 2.0.5) |
SDL_PIXELFORMAT_ARGB32 |
alias for ARGB byte array of color data, for the current platform (>= SDL 2.0.5) |
SDL_PIXELFORMAT_BGRA32 |
alias for BGRA byte array of color data, for the current platform (>= SDL 2.0.5) |
SDL_PIXELFORMAT_ABGR32 |
alias for ABGR byte array of color data, for the current platform (>= SDL 2.0.5) |
SDL_PIXELFORMAT_YV12 |
planar mode: Y + V + U (3 planes) |
SDL_PIXELFORMAT_IYUV |
planar mode: Y + U + V (3 planes) |
SDL_PIXELFORMAT_YUY2 |
packed mode: Y0+U0+Y1+V0 (1 plane) |
SDL_PIXELFORMAT_UYVY |
packed mode: U0+Y0+V0+Y1 (1 plane) |
SDL_PIXELFORMAT_YVYU |
packed mode: Y0+V0+Y1+U0 (1 plane) |
SDL_PIXELFORMAT_NV12 |
planar mode: Y + U/V interleaved (2 planes) (>= SDL 2.0.4) |
SDL_PIXELFORMAT_NV21 |
planar mode: Y + V/U interleaved (2 planes) (>= SDL 2.0.4) |
