|
Size: 3060
Comment: update content (old wiki)
|
Size: 3059
Comment: correct typo
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 23: | Line 23: |
| Returns *a pointer to* the new surface, or NULL if ,,this function,, ^it^ fails; call [[SDL_GetError]]() for more information. | Returns *a pointer to* the new surface or NULL if ,,this function,, ^it^ fails; call [[SDL_GetError]]() for more information. |
DRAFT |
SDL_ConvertSurface
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.
Contents
Syntax
SDL_Surface* SDL_ConvertSurface(SDL_Surface* src,
SDL_PixelFormat* fmt,
Uint32 flags)
Function Parameters
src |
the surface to copy and map from |
fmt |
the SDL_PixelFormat to apply |
flags |
the type of surface to be created???;see Remarks for details |
Return Value
Returns *a pointer to* the new surface or NULL if this function it fails; call SDL_GetError() for more information.
Code Examples
You can add your code example here
Remarks
The flags parameter is passed to SDL_CreateRGBSurface() and has those semantics. You can also pass SDL_RLEACCEL in the flags parameter and SDL will try to RLE accelerate colorkey and alpha blits in the resulting surface.
green
*
green
SDL_SWSURFACE |
SDL will create the surface in system memory. This improves the performance of pixel level access, however you may not be able to take advantage of some types of hardware blitting. |
SDL_HWSURFACE |
SDL will attempt to create the surface in video memory. This will allow SDL to take advantage of Video->Video blits (which are often accelerated). |
SDL_SRCCOLORKEY |
This flag turns on color keying for blits from this surface. If SDL_HWSURFACE is also specified and color keyed blits are hardware-accelerated, then SDL will attempt to place the surface in video memory. If the screen is a hardware surface and color keyed blits are hardware-accelerated then the SDL_HWSURFACE flag will be set. Use SDL_SetColorKey() to set or clear this flag after surface creation. |
SDL_SRCALPHA |
This flag turns on alpha-blending for blits from this surface. If SDL_HWSURFACE is also specified and alpha-blending blits are hardware-accelerated, then the surface will be placed in video memory if possible. If the screen is a hardware surface and alpha-blending blits are hardware-accelerated then the SDL_HWSURFACE flag will be set. Use SDL_SetAlpha to set or clear this flag after surface creation.green |
This function is used internally by SDL_DisplayFormat().
This function can only be called after SDL_Init().
*
