include/SDL_video.h
changeset 1985 8055185ae4ed
parent 1969 5d3724f64f2b
child 1986 f4c65e3bfaed
     1.1 --- a/include/SDL_video.h	Thu Aug 24 12:49:59 2006 +0000
     1.2 +++ b/include/SDL_video.h	Mon Aug 28 03:17:39 2006 +0000
     1.3 @@ -176,7 +176,7 @@
     1.4      SDL_RENDERER_PRESENTFLIP3 = 0x00000008,     /**< Present uses a flip, rotating between two back buffers and a front buffer */
     1.5      SDL_RENDERER_PRESENTDISCARD = 0x00000010,   /**< Present leaves the contents of the backbuffer undefined */
     1.6      SDL_RENDERER_PRESENTVSYNC = 0x00000020,     /**< Present is synchronized with the refresh rate */
     1.7 -    SDL_RENDERER_ACCELERATED = 0x00000040,      /**< The renderer uses hardware acceleration */
     1.8 +    SDL_RENDERER_ACCELERATED = 0x0000040,       /**< The renderer uses hardware acceleration */
     1.9  } SDL_RendererFlags;
    1.10  
    1.11  /**
    1.12 @@ -188,6 +188,7 @@
    1.13  {
    1.14      const char *name;           /**< The name of the renderer */
    1.15      Uint32 flags;               /**< Supported SDL_RendererFlags */
    1.16 +    Uint32 mod_modes;           /**< A mask of supported channel modulation */
    1.17      Uint32 blend_modes;         /**< A mask of supported blend modes */
    1.18      Uint32 scale_modes;         /**< A mask of supported scale modes */
    1.19      Uint32 num_texture_formats; /**< The number of available texture formats */
    1.20 @@ -208,9 +209,21 @@
    1.21  } SDL_TextureAccess;
    1.22  
    1.23  /**
    1.24 + * \enum SDL_TextureModulate
    1.25 + *
    1.26 + * \brief The texture channel modulation used in SDL_RenderCopy()
    1.27 + */
    1.28 +typedef enum
    1.29 +{
    1.30 +    SDL_TEXTUREMODULATE_NONE = 0x00000000,     /**< No modulation */
    1.31 +    SDL_TEXTUREMODULATE_COLOR = 0x00000001,    /**< srcC = srcC * color */
    1.32 +    SDL_TEXTUREMODULATE_ALPHA = 0x00000002,    /**< srcA = srcA * alpha */
    1.33 +} SDL_TextureModulate;
    1.34 +
    1.35 +/**
    1.36   * \enum SDL_TextureBlendMode
    1.37   *
    1.38 - * \brief The blend mode used in SDL_RenderCopy()
    1.39 + * \brief The texture blend mode used in SDL_RenderCopy()
    1.40   */
    1.41  typedef enum
    1.42  {
    1.43 @@ -224,7 +237,7 @@
    1.44  /**
    1.45   * \enum SDL_TextureScaleMode
    1.46   *
    1.47 - * \brief The scale mode used in SDL_RenderCopy()
    1.48 + * \brief The texture scale mode used in SDL_RenderCopy()
    1.49   */
    1.50  typedef enum
    1.51  {
    1.52 @@ -272,12 +285,15 @@
    1.53      int pitch;                  /* Read-only */
    1.54      void *pixels;               /* Read-write */
    1.55  
    1.56 +    /* Application data associated with the surfade */
    1.57 +    void *userdata;             /* Read-write */
    1.58 +
    1.59      /* texture associated with the surface, if any */
    1.60 -    SDL_TextureID textureID;
    1.61 +    SDL_TextureID textureID;    /* Read-only */
    1.62  
    1.63      /* information needed for surfaces requiring locks */
    1.64 -    int locked;
    1.65 -    void *lock_data;
    1.66 +    int locked;                 /* Read-only */
    1.67 +    void *lock_data;            /* Read-only */
    1.68  
    1.69      /* clipping information */
    1.70      SDL_Rect clip_rect;         /* Read-only */
    1.71 @@ -998,6 +1014,136 @@
    1.72                                                    int ncolors);
    1.73  
    1.74  /**
    1.75 + * \fn int SDL_SetTextureColorMod(SDL_TextureID textureID, Uint8 r, Uint8 g, Uint8 b)
    1.76 + *
    1.77 + * \brief Set an additional color value used in render copy operations
    1.78 + *
    1.79 + * \param texture The texture to update
    1.80 + * \param r The red source color value multiplied into copy operations
    1.81 + * \param g The green source color value multiplied into copy operations
    1.82 + * \param b The blue source color value multiplied into copy operations
    1.83 + *
    1.84 + * \return 0 on success, or -1 if the texture is not valid or color modulation is not supported
    1.85 + *
    1.86 + * \sa SDL_GetTextureColorMod()
    1.87 + */
    1.88 +extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_TextureID textureID,
    1.89 +                                                   Uint8 r, Uint8 g, Uint8 b);
    1.90 +
    1.91 +
    1.92 +/**
    1.93 + * \fn int SDL_GetTextureColorMod(SDL_TextureID textureID, Uint8 *r, Uint8 *g, Uint8 *b)
    1.94 + *
    1.95 + * \brief Get the additional color value used in render copy operations
    1.96 + *
    1.97 + * \param texture The texture to query
    1.98 + * \param r A pointer filled in with the source red color value
    1.99 + * \param g A pointer filled in with the source green color value
   1.100 + * \param b A pointer filled in with the source blue color value
   1.101 + *
   1.102 + * \return 0 on success, or -1 if the texture is not valid
   1.103 + *
   1.104 + * \sa SDL_SetTextureColorMod()
   1.105 + */
   1.106 +extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_TextureID textureID,
   1.107 +                                                   Uint8 * r, Uint8 * g,
   1.108 +                                                   Uint8 * b);
   1.109 +
   1.110 +/**
   1.111 + * \fn int SDL_SetTextureAlphaMod(SDL_TextureID textureID, Uint8 alpha)
   1.112 + *
   1.113 + * \brief Set an additional alpha value used in render copy operations
   1.114 + *
   1.115 + * \param texture The texture to update
   1.116 + * \param alpha The source alpha value multiplied into copy operations.
   1.117 + *
   1.118 + * \return 0 on success, or -1 if the texture is not valid or alpha modulation is not supported
   1.119 + *
   1.120 + * \sa SDL_GetTextureAlphaMod()
   1.121 + */
   1.122 +extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_TextureID textureID,
   1.123 +                                                   Uint8 alpha);
   1.124 +
   1.125 +/**
   1.126 + * \fn int SDL_GetTextureAlphaMod(SDL_TextureID textureID, Uint8 *alpha)
   1.127 + *
   1.128 + * \brief Get the additional alpha value used in render copy operations
   1.129 + *
   1.130 + * \param texture The texture to query
   1.131 + * \param alpha A pointer filled in with the source alpha value
   1.132 + *
   1.133 + * \return 0 on success, or -1 if the texture is not valid
   1.134 + *
   1.135 + * \sa SDL_SetTextureAlphaMod()
   1.136 + */
   1.137 +extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_TextureID textureID,
   1.138 +                                                   Uint8 * alpha);
   1.139 +
   1.140 +/**
   1.141 + * \fn int SDL_SetTextureBlendMode(SDL_TextureID textureID, int blendMode)
   1.142 + *
   1.143 + * \brief Set the blend mode used for texture copy operations
   1.144 + *
   1.145 + * \param texture The texture to update
   1.146 + * \param blendMode SDL_TextureBlendMode to use for texture blending
   1.147 + *
   1.148 + * \return 0 on success, or -1 if the texture is not valid or the blend mode is not supported
   1.149 + *
   1.150 + * \note If the blend mode is not supported, the closest supported mode is chosen.
   1.151 + *
   1.152 + * \sa SDL_GetTextureBlendMode()
   1.153 + */
   1.154 +extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_TextureID textureID,
   1.155 +                                                    int blendMode);
   1.156 +
   1.157 +/**
   1.158 + * \fn int SDL_GetTextureBlendMode(SDL_TextureID textureID, int *blendMode)
   1.159 + *
   1.160 + * \brief Get the blend mode used for texture copy operations
   1.161 + *
   1.162 + * \param texture The texture to query
   1.163 + * \param blendMode A pointer filled in with the current blend mode
   1.164 + *
   1.165 + * \return 0 on success, or -1 if the texture is not valid
   1.166 + *
   1.167 + * \sa SDL_SetTextureBlendMode()
   1.168 + */
   1.169 +extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_TextureID textureID,
   1.170 +                                                    int *blendMode);
   1.171 +
   1.172 +/**
   1.173 + * \fn int SDL_SetTextureScaleMode(SDL_TextureID textureID, int scaleMode)
   1.174 + *
   1.175 + * \brief Set the scale mode used for texture copy operations
   1.176 + *
   1.177 + * \param texture The texture to update
   1.178 + * \param scaleMode SDL_TextureScaleMode to use for texture scaling
   1.179 + *
   1.180 + * \return 0 on success, or -1 if the texture is not valid or the scale mode is not supported
   1.181 + *
   1.182 + * \note If the scale mode is not supported, the closest supported mode is chosen.
   1.183 + *
   1.184 + * \sa SDL_GetTextureScaleMode()
   1.185 + */
   1.186 +extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_TextureID textureID,
   1.187 +                                                    int scaleMode);
   1.188 +
   1.189 +/**
   1.190 + * \fn int SDL_GetTextureScaleMode(SDL_TextureID textureID, int *scaleMode)
   1.191 + *
   1.192 + * \brief Get the scale mode used for texture copy operations
   1.193 + *
   1.194 + * \param texture The texture to query
   1.195 + * \param scaleMode A pointer filled in with the current scale mode
   1.196 + *
   1.197 + * \return 0 on success, or -1 if the texture is not valid
   1.198 + *
   1.199 + * \sa SDL_SetTextureScaleMode()
   1.200 + */
   1.201 +extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_TextureID textureID,
   1.202 +                                                    int *scaleMode);
   1.203 +
   1.204 +/**
   1.205   * \fn int SDL_UpdateTexture(SDL_TextureID textureID, const SDL_Rect *rect, const void *pixels, int pitch)
   1.206   *
   1.207   * \brief Update the given texture rectangle with new pixel data.
   1.208 @@ -1061,37 +1207,35 @@
   1.209                                                const SDL_Rect * rects);
   1.210  
   1.211  /**
   1.212 - * \fn void SDL_RenderFill(const SDL_Rect *rect, Uint32 color)
   1.213 + * \fn void SDL_RenderFill(Uint8 r, Uint8 g, Uint8 b, Uint8 a, const SDL_Rect *rect)
   1.214   *
   1.215   * \brief Fill the current rendering target with the specified color.
   1.216   *
   1.217 + * \param r The red value used to fill the rendering target
   1.218 + * \param g The green value used to fill the rendering target
   1.219 + * \param b The blue value used to fill the rendering target
   1.220 + * \param a The alpha value used to fill the rendering target, usually SDL_ALPHA_OPAQUE (255)
   1.221   * \param rect A pointer to the destination rectangle, or NULL for the entire rendering target.
   1.222 - * \param color An ARGB color value.
   1.223   *
   1.224   * \return 0 on success, or -1 if there is no rendering context current
   1.225   */
   1.226 -extern DECLSPEC int SDLCALL SDL_RenderFill(const SDL_Rect * rect,
   1.227 -                                           Uint32 color);
   1.228 +extern DECLSPEC int SDLCALL SDL_RenderFill(Uint8 r, Uint8 g, Uint8 b, Uint8 a,
   1.229 +                                           const SDL_Rect * rect);
   1.230  
   1.231  /**
   1.232 - * \fn int SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect *srcrect, const SDL_Rect *dstrect, Uint32 blendMode, Uint32 scaleMode)
   1.233 + * \fn int SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect *srcrect, const SDL_Rect *dstrect)
   1.234   *
   1.235   * \brief Copy a portion of the texture to the current rendering target.
   1.236   *
   1.237   * \param texture The source texture.
   1.238   * \param srcrect A pointer to the source rectangle, or NULL for the entire texture.
   1.239   * \param dstrect A pointer to the destination rectangle, or NULL for the entire rendering target.
   1.240 - * \param blendMode SDL_TextureBlendMode to be used if the source texture has an alpha channel.
   1.241 - * \param scaleMode SDL_TextureScaleMode to be used if the source and destination rectangles don't have the same width and height.
   1.242   *
   1.243   * \return 0 on success, or -1 if there is no rendering context current, or the driver doesn't support the requested operation.
   1.244 - *
   1.245 - * \note You can check the video driver info to see what operations are supported.
   1.246   */
   1.247  extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_TextureID textureID,
   1.248                                             const SDL_Rect * srcrect,
   1.249 -                                           const SDL_Rect * dstrect,
   1.250 -                                           int blendMode, int scaleMode);
   1.251 +                                           const SDL_Rect * dstrect);
   1.252  
   1.253  /**
   1.254   * \fn int SDL_RenderReadPixels(const SDL_Rect *rect, void *pixels, int pitch)