anchor.diff:  #define SDL_SaveBMP(surface, file) \
   		SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
   
  -/**
  - *  \brief Sets the RLE acceleration hint for a surface.
  +{**
  + *  Sets the RLE acceleration hint for a surface.
    *  
  - *  \return 0 on success, or -1 if the surface is not valid
  + *  0 on success, or -1 if the surface is not valid
    *  
  - *  \note If RLE is enabled, colorkey and alpha blending blits are much faster,
  - *        but the surface must be locked before directly accessing the pixels.
  - */
  -extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
  -                                              int flag);
  -
  -/**
  - *  \brief Sets the color key (transparent pixel) in a blittable surface.
  + *  If RLE is enabled, colorkey and alpha blending blits are much faster,
  + *  but the surface must be locked before directly accessing the pixels.
  + *}
  +
  +function SDL_SetSurfaceRLE(surface: PSDLSurface; flag: SInt32): SInt32 cdecl external {$IFDEF GPC} name 'SDL_SetSurfaceRLE' {$ELSE} SDL_LibName {$ENDIF};
  +
  +{**
  + *  Sets the color key (transparent pixel) in a blittable surface.
  + *
  + *  surface The surface to update
  + *  flag Non-zero to enable colorkey and 0 to disable colorkey
  + *  key The transparent pixel in the native surface format
    *  
  - *  \param surface The surface to update
  - *  \param flag Non-zero to enable colorkey and 0 to disable colorkey
  - *  \param key The transparent pixel in the native surface format
  - *  
  - *  \return 0 on success, or -1 if the surface is not valid
  + *  0 on success, or -1 if the surface is not valid
    *
    *  You can pass SDL_RLEACCEL to enable RLE accelerated blits.
  - */
  -extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
  -                                            int flag, Uint32 key);
  -
  -/**
  - *  \brief Gets the color key (transparent pixel) in a blittable surface.
  + *}
  +
  +function SDL_SetColorKey(surface: PSDLSurface; flag: SInt32; key: UInt32): SInt32 cdecl external {$IFDEF GPC} name 'SDL_SetColorKey' {$ELSE} SDL_LibName {$ENDIF};
  +
  +{**
  + *  Gets the color key (transparent pixel) in a blittable surface.
    *  
  - *  \param surface The surface to update
  - *  \param key A pointer filled in with the transparent pixel in the native 
  - *             surface format
  + *  surface The surface to update
  + *  key A pointer filled in with the transparent pixel in the native
  + *      surface format
    *  
  - *  \return 0 on success, or -1 if the surface is not valid or colorkey is not 
  - *          enabled.
  - */
  -extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
  -                                            Uint32 * key);
  -
  -/**
  - *  \brief Set an additional color value used in blit operations.
  + *  0 on success, or -1 if the surface is not valid or colorkey is not
  + *  enabled.
  + *}
  +
  +function SDL_GetColorKey(surface: PSDLSurface; key: PUInt32): SInt32 cdecl external {$IFDEF GPC} name 'SDL_GetColorKey' {$ELSE} SDL_LibName {$ENDIF};
  +
  +{**
  + *  Set an additional color value used in blit operations.
    *  
  - *  \param surface The surface to update.
  - *  \param r The red color value multiplied into blit operations.
  - *  \param g The green color value multiplied into blit operations.
  - *  \param b The blue color value multiplied into blit operations.
  + *  surface The surface to update.
  + *  r The red color value multiplied into blit operations.
  + *  g The green color value multiplied into blit operations.
  + *  b The blue color value multiplied into blit operations.
  + *
  + *  0 on success, or -1 if the surface is not valid.
  + *
  + *  SDL_GetSurfaceColorMod()
  + *}
  +
  +function SDL_SetSurfaceColorMod(surface: PSDLSurface; r: UInt8; g: UInt8; b: UInt8): SInt32 cdecl external {$IFDEF GPC} name 'SDL_SetSurfaceColorMod' {$ELSE} SDL_LibName {$ENDIF};
  +
  +
  +{**
  + *  Get the additional color value used in blit operations.
    *  
  - *  \return 0 on success, or -1 if the surface is not valid.
  + *  surface The surface to query.
  + *  r A pointer filled in with the current red color value.
  + *  g A pointer filled in with the current green color value.
  + *  b A pointer filled in with the current blue color value.
    *  
  - *  \sa SDL_GetSurfaceColorMod()
  - */
  -extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
  -                                                   Uint8 r, Uint8 g, Uint8 b);
  -
  -
  -/**
  - *  \brief Get the additional color value used in blit operations.
  + *  0 on success, or -1 if the surface is not valid.
    *  
  - *  \param surface The surface to query.
  - *  \param r A pointer filled in with the current red color value.
  - *  \param g A pointer filled in with the current green color value.
  - *  \param b A pointer filled in with the current blue color value.
  + *  SDL_SetSurfaceColorMod()
  + *}
  +
  +function SDL_GetSurfaceColorMod(surface: PSDLSurface; r: UInt8; g: UInt8; b: UInt8): SInt32 cdecl external {$IFDEF GPC} name 'SDL_GetSurfaceColorMod' {$ELSE} SDL_LibName {$ENDIF};
  +
  +{**
  + *  Set an additional alpha value used in blit operations.
    *  
  - *  \return 0 on success, or -1 if the surface is not valid.
  + *  surface The surface to update.
  + *  alpha The alpha value multiplied into blit operations.
    *  
  - *  \sa SDL_SetSurfaceColorMod()
  - */
  -extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
  -                                                   Uint8 * r, Uint8 * g,
  -                                                   Uint8 * b);
  -
  -/**
  - *  \brief Set an additional alpha value used in blit operations.
  + *  0 on success, or -1 if the surface is not valid.
  + *
  + *  SDL_GetSurfaceAlphaMod()
  + *}
  +
  +function SDL_SetSurfaceAlphaMod(surface: PSDLSurface; alpha: UInt8): SInt32 cdecl external {$IFDEF GPC} name 'SDL_SetSurfaceAlphaMod' {$ELSE} SDL_LibName {$ENDIF};
  +
  +{**
  + *  Get the additional alpha value used in blit operations.
    *  
  - *  \param surface The surface to update.
  - *  \param alpha The alpha value multiplied into blit operations.
  + *  surface The surface to query.
  + *  alpha A pointer filled in with the current alpha value.
    *  
  - *  \return 0 on success, or -1 if the surface is not valid.
  + *  0 on success, or -1 if the surface is not valid.
    *  
  - *  \sa SDL_GetSurfaceAlphaMod()
  - */
  -extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
  -                                                   Uint8 alpha);
  -
  -/**
  - *  \brief Get the additional alpha value used in blit operations.
  + *  SDL_SetSurfaceAlphaMod()
  + *}
  +
  +function SDL_GetSurfaceAlphaMod(surface: PSDLSurface; alpha: PUInt8): SInt32 cdecl external {$IFDEF GPC} name 'SDL_GetSurfaceAlphaMod' {$ELSE} SDL_LibName {$ENDIF};
  +
  +{**
  + *  Set the blend mode used for blit operations.
    *  
  - *  \param surface The surface to query.
  - *  \param alpha A pointer filled in with the current alpha value.
  + *  surface The surface to update.
  + *  blendMode ::SDL_BlendMode to use for blit blending.
    *  
  - *  \return 0 on success, or -1 if the surface is not valid.
  + *  0 on success, or -1 if the parameters are not valid.
    *  
  - *  \sa SDL_SetSurfaceAlphaMod()
  - */
  -extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
  -                                                   Uint8 * alpha);
  -
  -/**
  - *  \brief Set the blend mode used for blit operations.
  + *  SDL_GetSurfaceBlendMode()
  + *}
  +
  +function SDL_SetSurfaceBlendMode(surface: PSDLSurface; blendMode: TSDLBlendMode): SInt32;
  +
  +{**
  + *  Get the blend mode used for blit operations.
    *  
  - *  \param surface The surface to update.
  - *  \param blendMode ::SDL_BlendMode to use for blit blending.
  + *  surface   The surface to query.
  + *  blendMode A pointer filled in with the current blend mode.
    *  
  - *  \return 0 on success, or -1 if the parameters are not valid.
  + *  0 on success, or -1 if the surface is not valid.
    *  
  - *  \sa SDL_GetSurfaceBlendMode()
  - */
  -extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
  -                                                    SDL_BlendMode blendMode);
  -
  -/**
  - *  \brief Get the blend mode used for blit operations.
  - *  
  - *  \param surface   The surface to query.
  - *  \param blendMode A pointer filled in with the current blend mode.
  - *  
  - *  \return 0 on success, or -1 if the surface is not valid.
  - *  
  - *  \sa SDL_SetSurfaceBlendMode()
  - */
  -extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
  -                                                    SDL_BlendMode *blendMode);
  -
  -/**
  + *  SDL_SetSurfaceBlendMode()
  + *}
  +
  +function SDL_GetSurfaceBlendMode(surface: PSDLSurface; blendMode: PSDLBlendMode): SInt32;
  +
  +{**
    *  Sets the clipping rectangle for the destination surface in a blit.
    *  
    *  If the clip rectangle is NULL, clipping will be disabled.
  
positive.code:  *  blitting works internally and how to use the other blit functions.
   *}
  
  #define SDL_BlitSurface SDL_UpperBlit
  
  /**
   *  This is the public blit function, SDL_BlitSurface(), and it performs
   *  rectangle validation and clipping before passing it to SDL_LowerBlit()
   */
  extern DECLSPEC int SDLCALL SDL_UpperBlit
      (SDL_Surface * src, const SDL_Rect * srcrect,
       SDL_Surface * dst, SDL_Rect * dstrect);
  
  /**
   *  This is a semi-private blit function and it performs low-level surface
   *  blitting only.
   */
  extern DECLSPEC int SDLCALL SDL_LowerBlit
      (SDL_Surface * src, SDL_Rect * srcrect,
       SDL_Surface * dst, SDL_Rect * dstrect);
  
  /**
   *  \brief Perform a fast, low quality, stretch blit between two surfaces of the
   *         same pixel format.
   *  
   *  \note This function uses a static buffer, and is not thread-safe.
   */
  extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
                                              const SDL_Rect * srcrect,
                                              SDL_Surface * dst,
                                              const SDL_Rect * dstrect);
  
  #define SDL_BlitScaled SDL_UpperBlitScaled
  
  /**
   *  This is the public scaled blit function, SDL_BlitScaled(), and it performs
   *  rectangle validation and clipping before passing it to SDL_LowerBlitScaled()
   */
  extern DECLSPEC int SDLCALL SDL_UpperBlitScaled
      (SDL_Surface * src, const SDL_Rect * srcrect,
      SDL_Surface * dst, SDL_Rect * dstrect);
  
negative.code:  *  return SDL_FALSE and blits will be completely clipped.  Otherwise the
   *  function returns SDL_TRUE and blits to the surface will be clipped to
   *  the intersection of the surface area and the clipping rectangle.
   *
   *  Note that blits are automatically clipped to the edges of the source
   *  and destination surfaces.
   *}
  
  function SDL_SetClipRect(surface: PSDLSurface; const rect: PSDLRect): TSDLBool;
  
  {**
   *  Gets the clipping rectangle for the destination surface in a blit.
   *
   *  rect must be a pointer to a valid rectangle which will be filled
   *  with the correct values.
   *}
  
  procedure SDL_GetClipRect(surface: PSDLSurface; rect: PSDLRect);
  
  {**
   *  Creates a new surface of the specified format, and then copies and maps
   *  the given surface to it so the blit of the converted surface will be as
   *  fast as possible.  If this function fails, it returns NULL.
   *
   *  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.
   *}
  
  function SDL_ConvertSurface(SDL_Surface * src, SDL_PixelFormat * fmt, Uint32 flags): PSDLSurface;
  function SDL_ConvertSurfaceFormat(SDL_Surface * src, Uint32 pixel_format, Uint32 flags): PSDLSurface;
  
  {**
   *  Copy a block of pixels of one format to another format
   *
   *  0 on success, or -1 if there was an error
   *}
  
  function SDL_ConvertPixels(width: SInt32; height: SInt32; src_format: UInt32; const src: Pointer; src_pitch: SInt32; Uint32 dst_format; dst: Pointer; dst_pitch: SInt32): SInt32;;
  
  {**
   *  Performs a fast fill of the given rectangle with color.
   *  
   *  If rect is NULL, the whole surface will be filled with color.
   *  
   *  The color should be a pixel of the format used by the surface, and 
   *  can be generated by the SDL_MapRGB() function.
   *  
   *  0 on success, or -1 on error.
   *}
  
  extern DECLSPEC int SDLCALL SDL_FillRect
      (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
  extern DECLSPEC int SDLCALL SDL_FillRects
  