@@ -660,6 +660,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Rende
660
660
* pixels, required
661
661
* - `SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER`: the height of the texture in
662
662
* pixels, required
663
+ * - `SDL_PROP_TEXTURE_CREATE_PALETTE_POINTER`: an SDL_Palette to use with the texture, optional.
663
664
* - `SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT`: for HDR10 and floating
664
665
* point textures, this defines the value of 100% diffuse white, with higher
665
666
* values being displayed in the High Dynamic Range headroom. This defaults
@@ -759,6 +760,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureWithProperties(SDL_Re
759
760
#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER "SDL.texture.create.access"
760
761
#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER "SDL.texture.create.width"
761
762
#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER "SDL.texture.create.height"
763
+ #define SDL_PROP_TEXTURE_CREATE_PALETTE_POINTER "SDL.texture.create.palette"
762
764
#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT "SDL.texture.create.SDR_white_point"
763
765
#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT "SDL.texture.create.HDR_headroom"
764
766
#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER "SDL.texture.create.d3d11.texture"
@@ -929,6 +931,40 @@ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_GetRendererFromTexture(SDL_Textur
929
931
*/
930
932
extern SDL_DECLSPEC bool SDLCALL SDL_GetTextureSize (SDL_Texture * texture , float * w , float * h );
931
933
934
+ /**
935
+ * Set the palette used by a texture.
936
+ *
937
+ * A single palette can be shared with many textures.
938
+ *
939
+ * \param texture the texture to update.
940
+ * \param palette the SDL_Palette structure to use.
941
+ * \returns true on success or false on failure; call SDL_GetError() for more
942
+ * information.
943
+ *
944
+ * \threadsafety This function should only be called on the main thread.
945
+ *
946
+ * \since This function is available since SDL 3.4.0.
947
+ *
948
+ * \sa SDL_CreatePalette
949
+ * \sa SDL_GetTexturePalette
950
+ */
951
+ extern SDL_DECLSPEC bool SDLCALL SDL_SetTexturePalette (SDL_Texture * texture , SDL_Palette * palette );
952
+
953
+ /**
954
+ * Get the palette used by a texture.
955
+ *
956
+ * \param texture the texture to query.
957
+ * \returns a pointer to the palette used by the texture, or NULL if there is
958
+ * no palette used.
959
+ *
960
+ * \threadsafety This function should only be called on the main thread.
961
+ *
962
+ * \since This function is available since SDL 3.4.0.
963
+ *
964
+ * \sa SDL_SetTexturePalette
965
+ */
966
+ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetTexturePalette (SDL_Texture * texture );
967
+
932
968
/**
933
969
* Set an additional color value multiplied into render copy operations.
934
970
*
@@ -1155,7 +1191,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, S
1155
1191
/**
1156
1192
* Set the scale mode used for texture scale operations.
1157
1193
*
1158
- * The default texture scale mode is SDL_SCALEMODE_LINEAR.
1194
+ * The default texture scale mode is SDL_SCALEMODE_LINEAR for RGB and YUV textures and SDL_SCALEMODE_PIXELART for indexed textures .
1159
1195
*
1160
1196
* If the scale mode is not supported, the closest supported mode is chosen.
1161
1197
*
0 commit comments