|
Size: 3100
Comment: update formatting - enums, structs, the/an
|
Size: 1043
Comment: update content - w/ Sam; remove draft
|
| 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 into a new surface that is optimized for a specified pixel format. |
| Line 9: | Line 8: |
| Line 17: | Line 17: |
| Line 18: | Line 19: |
| ||'''src'''||the [[SDL_Surface]] structure to copy and map from|| ||'''fmt'''||an [[SDL_PixelFormat]] structure to apply|| ||'''flags'''||^the type of surface to be created^???;see [[#Remarks|Remarks]] for details|| |
||'''src'''||the existing [[SDL_Surface]] structure to convert|| ||'''fmt'''||the new [[SDL_PixelFormat]] structure|| ||'''flags'''||unused; set to 0|| |
| Line 31: | Line 32: |
| 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. <<Color2(green,SDL_CreateRGBSurface() says '''flags''' param is obsolete and should be set to 0. Does that affect this function?)>> *<<BR>><<Color2(green,'''flags''' in 1.2 were:)>> ||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.<<Color2(green,SDL_!SetAlpha does not have a page in 1.3. Is it the same as SDL_!SetSurfaceAlphaMod?)>>|| This function is used internally by [[SDL_DisplayFormat]](). <<Color2(green,Replaced in 1.3?)>> This function can only be called after [[SDL_Init]](). <<BR>>* |
''You can add useful comments here'' |
SDL_ConvertSurface
Use this function to copy an existing surface into a new surface that is optimized for a specified pixel format.
Contents
Syntax
SDL_Surface* SDL_ConvertSurface(SDL_Surface* src,
SDL_PixelFormat* fmt,
Uint32 flags)
Function Parameters
src |
the existing SDL_Surface structure to convert |
fmt |
the new SDL_PixelFormat structure |
flags |
unused; set to 0 |
Return Value
Returns *a pointer to* the new SDL_Surface structure that is created or NULL if this function it fails; call SDL_GetError() for more information.
Code Examples
You can add your code example here
Remarks
You can add useful comments here
