SDLGameEngine

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

Data Structures | Defines | Enumerations | Enumerator | Functions | Variables

# SgeFadeFX

Effects for fading between screens. More...

## Data Structures
struct | SGEFADEFX
## Defines
#define | sgeFadeFXDeleteSprites(fx, yesno) sgeFadeFXDeleteSurfaces(fx, yesno)
| when destroying the effect, should the image resources be destroyed too?
## Enumerations
enum | SGEFADEFX_TYPES { SGEFADEFX_FADE, SGEFADEFX_WIPE_LEFT, SGEFADEFX_WIPE_RIGHT, SGEFADEFX_WIPE_TOP, SGEFADEFX_WIPE_BOTTOM, SGEFADEFX_SCROLL_LEFT, SGEFADEFX_SCROLL_RIGHT, SGEFADEFX_SCROLL_TOP, SGEFADEFX_SCROLL_BOTTOM }
## Functions
SGEFADEFX * | sgeFadeFXNew (Uint32 type, Uint32 runTime, SGESPRITE *source, SGESPRITE *destination)
| create a new fade effect from between two sprites
SGEFADEFX * | sgeFadeFXNewSDLSurface (Uint32 type, Uint32 runTime, SDL_Surface *source, SDL_Surface *destination)
| create a new fade effect from between two SDL_Surface images
void | sgeFadeFXDestroy (SGEFADEFX *fx)
| destroy the SGEFADEFX and free resources
void | sgeFadeFXDeleteSurfaces (SGEFADEFX *fx, Uint8 yesno)
| when destroying the effect, should the image resources be destroyed too?
void | sgeFadeFXPreDelay (SGEFADEFX *fx, Uint32 delay)
| set a delay before starting the fade
void | sgeFadeFXPostDelay (SGEFADEFX *fx, Uint32 delay)
| set a delay between the actual fade beeing finished and sgeFadeFXFinished returning true
void | sgeFadeFXSetTarget (SGEFADEFX *fx, SDL_Surface *surface)
| set the render target of the effect
void | sgeFadeFXDraw (SGEFADEFX *fx)
| draw the effect
int | sgeFadeFXFinished (SGEFADEFX *fx)
| check if the effect is finished
## Variables
void(* | SGEFADEFX::updateFunction )(void *)
| a pointer to the update function

## Detailed Description

Effects for fading between screens.

Functions to automatically blend between two images.

## Define Documentation

#define sgeFadeFXDeleteSprites | ( |  | fx,
|  |  | yesno
| ) |  | sgeFadeFXDeleteSurfaces(fx, yesno)

when destroying the effect, should the image resources be destroyed too?

Parameters:

  fx | a pointer to a SGEFADEFX
  yesno | YES/NO to destroy or not destroy the images

default behaviour is NOT to free the image resources

Definition at line 105 of file sgefadefx.h.

## Enumeration Type Documentation

enum SGEFADEFX_TYPES

Enumerator:

  SGEFADEFX_FADE | cross fade between two images
  SGEFADEFX_WIPE_LEFT | wipe the new image from the left side over the old image
  SGEFADEFX_WIPE_RIGHT | wipe the new image from the right side over the old image
  SGEFADEFX_WIPE_TOP | wipe the new image from the top over the old image
  SGEFADEFX_WIPE_BOTTOM | wipe the new image from the bottom over the old image
  SGEFADEFX_SCROLL_LEFT | scroll the new image in from the left side
  SGEFADEFX_SCROLL_RIGHT | scroll the new image in from the right side
  SGEFADEFX_SCROLL_TOP | scroll the new image in from the top
  SGEFADEFX_SCROLL_BOTTOM | scroll the new image in from the bottom

Definition at line 28 of file sgefadefx.h.

## Function Documentation

void sgeFadeFXDeleteSurfaces | ( | SGEFADEFX * | fx,
|  | Uint8 | yesno
| ) |  |

when destroying the effect, should the image resources be destroyed too?

Parameters:

  fx | a pointer to a SGEFADEFX
  yesno | YES/NO to destroy or not destroy the images

default behaviour is NOT to free the image resources

Definition at line 99 of file sgefadefx.c.

void sgeFadeFXDestroy | ( | SGEFADEFX * | fx | ) |

destroy the SGEFADEFX and free resources

Parameters:

  fx | a pointer to a SGEFADEFX

Definition at line 63 of file sgefadefx.c.

void sgeFadeFXDraw | ( | SGEFADEFX * | fx | ) |

draw the effect

Parameters:

  fx | a pointer to a SGEFADEFX

Definition at line 76 of file sgefadefx.c.

int sgeFadeFXFinished | ( | SGEFADEFX * | fx | ) |

check if the effect is finished

Parameters:

  fx | a pointer to a SGEFADEFX

Returns:
  YES/NO

Definition at line 103 of file sgefadefx.c.

SGEFADEFX* sgeFadeFXNew | ( | Uint32 | type,
|  | Uint32 | runTime,
|  | SGESPRITE * | source,
|  | SGESPRITE * | destination
| ) |  |

create a new fade effect from between two sprites

Parameters:

  type | the type of the effect ( SGEFADEFX_TYPES )
  runTime | the time the fade should take place in miliseconds
  source | the source SGESPRITE
  destination | the destination SGEPRITE

Returns:
  a pointer to a new SGEFADEFX

See also:
  SGEFADEFX_TYPES

Definition at line 43 of file sgefadefx.c.

SGEFADEFX* sgeFadeFXNewSDLSurface | ( | Uint32 | type,
|  | Uint32 | runTime,
|  | SDL_Surface * | source,
|  | SDL_Surface * | destination
| ) |  |

create a new fade effect from between two SDL_Surface images

Parameters:

  type | the type of the effect ( SGEFADEFX_TYPES )
  runTime | the time the fade should take place in miliseconds
  source | the source, as SDL_Surface
  destination | the destinatio, as SDL_Surface

Returns:
  a pointer to a new SGEFADEFX

See also:
  SGEFADEFX_TYPES

Definition at line 53 of file sgefadefx.c.

void sgeFadeFXPostDelay | ( | SGEFADEFX * | fx,
|  | Uint32 | delay
| ) |  |

set a delay between the actual fade beeing finished and sgeFadeFXFinished returning true

Parameters:

  fx | a pointer to a SGEFADEFX
  delay | the delay in miliseconds

Definition at line 111 of file sgefadefx.c.

void sgeFadeFXPreDelay | ( | SGEFADEFX * | fx,
|  | Uint32 | delay
| ) |  |

set a delay before starting the fade

Parameters:

  fx | a pointer to a SGEFADEFX
  delay | the delay in miliseconds

Definition at line 107 of file sgefadefx.c.

void sgeFadeFXSetTarget | ( | SGEFADEFX * | fx,
|  | SDL_Surface * | surface
| ) |  |

set the render target of the effect

Parameters:

  fx | a pointer to a SGEFADEFX
  surface | the target SDL_Surface

By default the effect is rendered to screen, but can be rendered to any SDL_Surface

Definition at line 115 of file sgefadefx.c.

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines