include/SDL_video.h
branchSDL-1.3
changeset 1681 80a5e6a4e1e2
parent 1678 90bf530ced8e
child 1682 7ae8018b2e5d
     1.1 --- a/include/SDL_video.h	Wed Jun 14 08:41:13 2006 +0000
     1.2 +++ b/include/SDL_video.h	Thu Jun 15 07:07:07 2006 +0000
     1.3 @@ -462,14 +462,26 @@
     1.4  extern DECLSPEC int SDLCALL SDL_SetDisplayMode(const SDL_DisplayMode * mode);
     1.5  
     1.6  /**
     1.7 - * \fn int SDL_SetDisplayColormap(SDL_Color *colors, int firstcolor, int ncolors)
     1.8 + * \fn int SDL_SetDisplayPalette(const SDL_Color *colors, int firstcolor, int ncolors)
     1.9   *
    1.10 - * \brief Set the colormap for indexed display modes.
    1.11 + * \brief Set the palette entries for indexed display modes.
    1.12   *
    1.13 - * \return 0 on success, or -1 if not all the colors could be set.
    1.14 + * \return 0 on success, or -1 if the display mode isn't palettized or the colors couldn't be set.
    1.15   */
    1.16 -extern DECLSPEC int SDLCALL SDL_SetDisplayColors(SDL_Color * colors,
    1.17 -                                                 int firstcolor, int ncolors);
    1.18 +extern DECLSPEC int SDLCALL SDL_SetDisplayPalette(const SDL_Color * colors,
    1.19 +                                                  int firstcolor,
    1.20 +                                                  int ncolors);
    1.21 +
    1.22 +/**
    1.23 + * \fn int SDL_GetDisplayPalette(SDL_Color *colors, int firstcolor, int ncolors)
    1.24 + *
    1.25 + * \brief Gets the palette entries for indexed display modes.
    1.26 + *
    1.27 + * \return 0 on success, or -1 if the display mode isn't palettized
    1.28 + */
    1.29 +extern DECLSPEC int SDLCALL SDL_GetDisplayPalette(SDL_Color * colors,
    1.30 +                                                  int firstcolor,
    1.31 +                                                  int ncolors);
    1.32  
    1.33  /**
    1.34   * \fn SDL_WindowID SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
    1.35 @@ -506,7 +518,7 @@
    1.36   *
    1.37   * \sa SDL_DestroyWindow()
    1.38   */
    1.39 -extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindowFrom(void *data);
    1.40 +extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindowFrom(const void *data);
    1.41  
    1.42  /**
    1.43   * \fn Uint32 SDL_GetWindowFlags(SDL_WindowID windowID)
    1.44 @@ -818,7 +830,7 @@
    1.45                                                     void **pixels, int *pitch);
    1.46  
    1.47  /**
    1.48 - * \fn int SDL_SetTexturePalette(SDL_TextureID textureID, SDL_Color * colors, int firstcolor, int ncolors)
    1.49 + * \fn int SDL_SetTexturePalette(SDL_TextureID textureID, const SDL_Color * colors, int firstcolor, int ncolors)
    1.50   *
    1.51   * \brief Update an indexed texture with a color palette
    1.52   *
    1.53 @@ -830,12 +842,29 @@
    1.54   * \return 0 on success, or -1 if the texture is not valid or not an indexed texture
    1.55   */
    1.56  extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_TextureID textureID,
    1.57 +                                                  const SDL_Color * colors,
    1.58 +                                                  int firstcolor,
    1.59 +                                                  int ncolors);
    1.60 +
    1.61 +/**
    1.62 + * \fn int SDL_GetTexturePalette(SDL_TextureID textureID, SDL_Color * colors, int firstcolor, int ncolors)
    1.63 + *
    1.64 + * \brief Update an indexed texture with a color palette
    1.65 + *
    1.66 + * \param texture The texture to update
    1.67 + * \param colors The array to fill with RGB color data
    1.68 + * \param firstcolor The first index to retrieve
    1.69 + * \param ncolors The number of palette entries to retrieve
    1.70 + *
    1.71 + * \return 0 on success, or -1 if the texture is not valid or not an indexed texture
    1.72 + */
    1.73 +extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_TextureID textureID,
    1.74                                                    SDL_Color * colors,
    1.75                                                    int firstcolor,
    1.76                                                    int ncolors);
    1.77  
    1.78  /**
    1.79 - * \fn int SDL_UpdateTexture(SDL_TextureID textureID, SDL_Rect *rect, const void *pixels, int pitch)
    1.80 + * \fn int SDL_UpdateTexture(SDL_TextureID textureID, const SDL_Rect *rect, const void *pixels, int pitch)
    1.81   *
    1.82   * \brief Update the given texture rectangle with new pixel data.
    1.83   *
    1.84 @@ -849,11 +878,11 @@
    1.85   * \note This is a very slow function for textures not created with SDL_TextureAccess_Local.
    1.86   */
    1.87  extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_TextureID textureID,
    1.88 -                                              SDL_Rect * rect,
    1.89 +                                              const SDL_Rect * rect,
    1.90                                                const void *pixels, int pitch);
    1.91  
    1.92  /**
    1.93 - * \fn void SDL_LockTexture(SDL_TextureID textureID, SDL_Rect *rect, int markDirty, void **pixels, int *pitch)
    1.94 + * \fn void SDL_LockTexture(SDL_TextureID textureID, const SDL_Rect *rect, int markDirty, void **pixels, int *pitch)
    1.95   *
    1.96   * \brief Lock a portion of the texture for pixel access.
    1.97   *
    1.98 @@ -869,8 +898,9 @@
    1.99   * \sa SDL_UnlockTexture()
   1.100   */
   1.101  extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_TextureID textureID,
   1.102 -                                            SDL_Rect * rect, int markDirty,
   1.103 -                                            void **pixels, int *pitch);
   1.104 +                                            const SDL_Rect * rect,
   1.105 +                                            int markDirty, void **pixels,
   1.106 +                                            int *pitch);
   1.107  
   1.108  /**
   1.109   * \fn void SDL_UnlockTexture(SDL_TextureID textureID)
   1.110 @@ -883,7 +913,7 @@
   1.111  extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_TextureID textureID);
   1.112  
   1.113  /**
   1.114 - * \fn void SDL_DirtyTexture(SDL_TextureID textureID, int numrects, SDL_Rect * rects)
   1.115 + * \fn void SDL_DirtyTexture(SDL_TextureID textureID, int numrects, const SDL_Rect * rects)
   1.116   *
   1.117   * \brief Mark the specified rectangles of the texture as dirty.
   1.118   *
   1.119 @@ -893,7 +923,8 @@
   1.120   * \sa SDL_UnlockTexture()
   1.121   */
   1.122  extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_TextureID textureID,
   1.123 -                                              int numrects, SDL_Rect * rects);
   1.124 +                                              int numrects,
   1.125 +                                              const SDL_Rect * rects);
   1.126  
   1.127  /**
   1.128   * \fn void SDL_SelectRenderTexture(SDL_TextureID textureID)
   1.129 @@ -905,7 +936,7 @@
   1.130  extern DECLSPEC void SDLCALL SDL_SelectRenderTexture(SDL_TextureID textureID);
   1.131  
   1.132  /**
   1.133 - * \fn void SDL_RenderFill(SDL_Rect *rect, Uint32 color)
   1.134 + * \fn void SDL_RenderFill(const SDL_Rect *rect, Uint32 color)
   1.135   *
   1.136   * \brief Fill the current rendering target with the specified color.
   1.137   *
   1.138 @@ -914,10 +945,11 @@
   1.139   *
   1.140   * \return 0 on success, or -1 if there is no renderer current
   1.141   */
   1.142 -extern DECLSPEC int SDLCALL SDL_RenderFill(SDL_Rect * rect, Uint32 color);
   1.143 +extern DECLSPEC int SDLCALL SDL_RenderFill(const SDL_Rect * rect,
   1.144 +                                           Uint32 color);
   1.145  
   1.146  /**
   1.147 - * \fn int SDL_RenderCopy(SDL_TextureID textureID, SDL_Rect *srcrect, SDL_Rect *dstrect, Uint32 blendMode, Uint32 scaleMode)
   1.148 + * \fn int SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect *srcrect, const SDL_Rect *dstrect, Uint32 blendMode, Uint32 scaleMode)
   1.149   *
   1.150   * \brief Copy a portion of the texture to the current rendering target.
   1.151   *
   1.152 @@ -932,12 +964,12 @@
   1.153   * \note You can check the video driver info to see what operations are supported.
   1.154   */
   1.155  extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_TextureID textureID,
   1.156 -                                           SDL_Rect * srcrect,
   1.157 -                                           SDL_Rect * dstrect, int blendMode,
   1.158 -                                           int scaleMode);
   1.159 +                                           const SDL_Rect * srcrect,
   1.160 +                                           const SDL_Rect * dstrect,
   1.161 +                                           int blendMode, int scaleMode);
   1.162  
   1.163  /**
   1.164 - * \fn int SDL_RenderReadPixels(SDL_Rect *rect, void *pixels, int pitch)
   1.165 + * \fn int SDL_RenderReadPixels(const SDL_Rect *rect, void *pixels, int pitch)
   1.166   *
   1.167   * \brief Read pixels from the current rendering target.
   1.168   *
   1.169 @@ -949,11 +981,11 @@
   1.170   *
   1.171   * \warning This is a very slow operation, and should not be used frequently.
   1.172   */
   1.173 -extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Rect * rect,
   1.174 +extern DECLSPEC int SDLCALL SDL_RenderReadPixels(const SDL_Rect * rect,
   1.175                                                   void *pixels, int pitch);
   1.176  
   1.177  /**
   1.178 - * \fn int SDL_RenderWritePixels(SDL_Rect *rect, const void *pixels, int pitch)
   1.179 + * \fn int SDL_RenderWritePixels(const SDL_Rect *rect, const void *pixels, int pitch)
   1.180   *
   1.181   * \brief Write pixels to the current rendering target.
   1.182   *
   1.183 @@ -965,7 +997,7 @@
   1.184   *
   1.185   * \warning This is a very slow operation, and should not be used frequently.
   1.186   */
   1.187 -extern DECLSPEC int SDLCALL SDL_RenderWritePixels(SDL_Rect * rect,
   1.188 +extern DECLSPEC int SDLCALL SDL_RenderWritePixels(const SDL_Rect * rect,
   1.189                                                    const void *pixels,
   1.190                                                    int pitch);
   1.191