include/SDL_video.h
changeset 2884 9dde605c7540
parent 2859 99210400e8b9
child 2886 633ce79b7a5b
     1.1 --- a/include/SDL_video.h	Sat Dec 20 08:41:05 2008 +0000
     1.2 +++ b/include/SDL_video.h	Sat Dec 20 12:00:00 2008 +0000
     1.3 @@ -206,18 +206,18 @@
     1.4  } SDL_TextureModulate;
     1.5  
     1.6  /**
     1.7 - * \enum SDL_TextureBlendMode
     1.8 + * \enum SDL_BlendMode
     1.9   *
    1.10 - * \brief The texture blend mode used in SDL_RenderCopy()
    1.11 + * \brief The blend mode used in SDL_RenderCopy() and drawing operations
    1.12   */
    1.13  typedef enum
    1.14  {
    1.15 -    SDL_TEXTUREBLENDMODE_NONE = 0x00000000,     /**< No blending */
    1.16 -    SDL_TEXTUREBLENDMODE_MASK = 0x00000001,     /**< dst = A ? src : dst (alpha is mask) */
    1.17 -    SDL_TEXTUREBLENDMODE_BLEND = 0x00000002,    /**< dst = (src * A) + (dst * (1-A)) */
    1.18 -    SDL_TEXTUREBLENDMODE_ADD = 0x00000004,      /**< dst = (src * A) + dst */
    1.19 -    SDL_TEXTUREBLENDMODE_MOD = 0x00000008       /**< dst = src * dst */
    1.20 -} SDL_TextureBlendMode;
    1.21 +    SDL_BLENDMODE_NONE = 0x00000000,     /**< No blending */
    1.22 +    SDL_BLENDMODE_MASK = 0x00000001,     /**< dst = A ? src : dst (alpha is mask) */
    1.23 +    SDL_BLENDMODE_BLEND = 0x00000002,    /**< dst = (src * A) + (dst * (1-A)) */
    1.24 +    SDL_BLENDMODE_ADD = 0x00000004,      /**< dst = (src * A) + dst */
    1.25 +    SDL_BLENDMODE_MOD = 0x00000008       /**< dst = src * dst */
    1.26 +} SDL_BlendMode;
    1.27  
    1.28  /**
    1.29   * \enum SDL_TextureScaleMode
    1.30 @@ -1141,9 +1141,80 @@
    1.31                                                const SDL_Rect * rects);
    1.32  
    1.33  /**
    1.34 - * \fn void SDL_RenderFill(Uint8 r, Uint8 g, Uint8 b, Uint8 a, const SDL_Rect *rect)
    1.35 + * \fn void SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a)
    1.36   *
    1.37 - * \brief Fill the current rendering target with the specified color.
    1.38 + * \brief Set the color used for drawing operations (Fill and Line).
    1.39 + *
    1.40 + * \param r The red value used to draw on the rendering target
    1.41 + * \param g The green value used to draw on the rendering target
    1.42 + * \param b The blue value used to draw on the rendering target
    1.43 + * \param a The alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255)
    1.44 + * \return 0 on success, or -1 if there is no rendering context current
    1.45 + */
    1.46 +extern DECLSPEC int SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b,
    1.47 +                                           Uint8 a);
    1.48 +
    1.49 +/**
    1.50 + * \fn void SDL_GetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a)
    1.51 + *
    1.52 + * \brief Get the color used for drawing operations (Fill and Line).
    1.53 + *
    1.54 + * \param r A pointer to the red value used to draw on the rendering target
    1.55 + * \param g A pointer to the green value used to draw on the rendering target
    1.56 + * \param b A pointer to the blue value used to draw on the rendering target
    1.57 + * \param a A pointer to the alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255)
    1.58 + * \return 0 on success, or -1 if there is no rendering context current
    1.59 + */
    1.60 +extern DECLSPEC int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b,
    1.61 +                                           Uint8 * a);
    1.62 +
    1.63 +/**
    1.64 + * \fn int SDL_SetRenderDrawBlendMode(int blendMode)
    1.65 + *
    1.66 + * \brief Set the blend mode used for drawing operations
    1.67 + *
    1.68 + * \param blendMode SDL_BlendMode to use for blending
    1.69 + *
    1.70 + * \return 0 on success, or -1 if there is no rendering context current
    1.71 + *
    1.72 + * \note If the blend mode is not supported, the closest supported mode is chosen.
    1.73 + *
    1.74 + * \sa SDL_SetRenderDrawBlendMode()
    1.75 + */
    1.76 +extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(int blendMode);
    1.77 +
    1.78 +/**
    1.79 + * \fn int SDL_GetRenderDrawBlendMode(int *blendMode)
    1.80 + *
    1.81 + * \brief Get the blend mode used for drawing operations
    1.82 + *
    1.83 + * \param blendMode A pointer filled in with the current blend mode
    1.84 + *
    1.85 + * \return 0 on success, or -1 if there is no rendering context current
    1.86 + *
    1.87 + * \sa SDL_SetRenderDrawBlendMode()
    1.88 + */
    1.89 +extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(int *blendMode);
    1.90 +
    1.91 +/**
    1.92 + * \fn void SDL_RenderLine(int x1, int y1, int x2, int y2)
    1.93 + *
    1.94 + * \brief Draw a line on the current rendering target.
    1.95 + *
    1.96 + * \param x1 The x coordinate of the start point
    1.97 + * \param y1 The y coordinate of the start point
    1.98 + * \param x2 The x coordinate of the end point
    1.99 + * \param y2 The y coordinate of the end point
   1.100 + *
   1.101 + * \return 0 on success, or -1 if there is no rendering context current
   1.102 + */
   1.103 +
   1.104 +extern DECLSPEC int SDLCALL SDL_RenderLine(int x1, int y1, int x2, int y2);
   1.105 +
   1.106 +/**
   1.107 + * \fn void SDL_RenderFill(const SDL_Rect *rect)
   1.108 + *
   1.109 + * \brief Fill the current rendering target with the drawing color.
   1.110   *
   1.111   * \param r The red value used to fill the rendering target
   1.112   * \param g The green value used to fill the rendering target
   1.113 @@ -1153,8 +1224,7 @@
   1.114   *
   1.115   * \return 0 on success, or -1 if there is no rendering context current
   1.116   */
   1.117 -extern DECLSPEC int SDLCALL SDL_RenderFill(Uint8 r, Uint8 g, Uint8 b, Uint8 a,
   1.118 -                                           const SDL_Rect * rect);
   1.119 +extern DECLSPEC int SDLCALL SDL_RenderFill(const SDL_Rect * rect);
   1.120  
   1.121  /**
   1.122   * \fn int SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect *srcrect, const SDL_Rect *dstrect)