Wiki Page Content

Differences between revisions 3 and 4
Revision 3 as of 2010-02-28 05:48:00
Size: 1306
Editor: SheenaSmith
Comment: minor change
Revision 4 as of 2010-08-08 23:32:03
Size: 3060
Editor: SheenaSmith
Comment: update content (old wiki)
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:
||'''flags'''||;see [[#Remarks|Remarks]] for details|| ||'''flags'''||^the type of surface to be created^???;see [[#Remarks|Remarks]] for details||
Line 23: Line 23:
Returns the new surface, or NULL if this function 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.
Line 33: Line 33:
<<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]]().

This function can only be called after [[SDL_Init]](). <<BR>>*
Line 34: Line 46:
 .[[SDL_OtherFunction]] (none?)  .[[SDL_CreateRGBSurface]]
 .[[SDL_DisplayFormat]] *<<Color2(green,Not in 1.3?)>>

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.

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().
*


CategoryAPI, CategorySurface

None: SDL_ConvertSurface (last edited 2020-03-10 19:12:34 by ChrisBush)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit