@@ -660,6 +660,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Rende
660660 * pixels, required
661661 * - `SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER`: the height of the texture in
662662 * pixels, required
663+ * - `SDL_PROP_TEXTURE_CREATE_PALETTE_POINTER`: an SDL_Palette to use with the texture, optional.
663664 * - `SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT`: for HDR10 and floating
664665 * point textures, this defines the value of 100% diffuse white, with higher
665666 * 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
759760#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER "SDL.texture.create.access"
760761#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER "SDL.texture.create.width"
761762#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER "SDL.texture.create.height"
763+ #define SDL_PROP_TEXTURE_CREATE_PALETTE_POINTER "SDL.texture.create.palette"
762764#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT "SDL.texture.create.SDR_white_point"
763765#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT "SDL.texture.create.HDR_headroom"
764766#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
929931 */
930932extern SDL_DECLSPEC bool SDLCALL SDL_GetTextureSize (SDL_Texture * texture , float * w , float * h );
931933
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+
932968/**
933969 * Set an additional color value multiplied into render copy operations.
934970 *
@@ -1155,7 +1191,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, S
11551191/**
11561192 * Set the scale mode used for texture scale operations.
11571193 *
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 .
11591195 *
11601196 * If the scale mode is not supported, the closest supported mode is chosen.
11611197 *
0 commit comments