SDL_surface.h 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2024 Sam Lantinga <[email protected]>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. /**
  19. * # CategorySurface
  20. *
  21. * SDL_Surface definition and management functions.
  22. */
  23. #ifndef SDL_surface_h_
  24. #define SDL_surface_h_
  25. #include <SDL3/SDL_stdinc.h>
  26. #include <SDL3/SDL_error.h>
  27. #include <SDL3/SDL_blendmode.h>
  28. #include <SDL3/SDL_pixels.h>
  29. #include <SDL3/SDL_properties.h>
  30. #include <SDL3/SDL_rect.h>
  31. #include <SDL3/SDL_iostream.h>
  32. #include <SDL3/SDL_begin_code.h>
  33. /* Set up for C function definitions, even when using C++ */
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. /**
  38. * The flags on an SDL_Surface.
  39. *
  40. * These are generally meant to be considered read-only.
  41. *
  42. * \since This datatype is available since SDL 3.0.0.
  43. */
  44. typedef Uint32 SDL_SurfaceFlags;
  45. #define SDL_SWSURFACE 0 /**< Just here for compatibility */
  46. #define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */
  47. #define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */
  48. #define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */
  49. #define SDL_SIMD_ALIGNED 0x00000008 /**< Surface uses aligned memory */
  50. #define SDL_SURFACE_USES_PROPERTIES 0x00000010 /**< Surface uses properties */
  51. /**
  52. * Evaluates to true if the surface needs to be locked before access.
  53. *
  54. * \since This macro is available since SDL 3.0.0.
  55. */
  56. #define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
  57. /**
  58. * An opaque type used in SDL_Surface.
  59. *
  60. * This is used by SDL to keep track of how blit operations should work
  61. * internally; it is not for use directly by applications.
  62. *
  63. * \since This struct is available since SDL 3.0.0.
  64. */
  65. typedef struct SDL_BlitMap SDL_BlitMap;
  66. /**
  67. * The scaling mode.
  68. *
  69. * \since This enum is available since SDL 3.0.0.
  70. */
  71. typedef enum SDL_ScaleMode
  72. {
  73. SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */
  74. SDL_SCALEMODE_LINEAR, /**< linear filtering */
  75. SDL_SCALEMODE_BEST /**< anisotropic filtering */
  76. } SDL_ScaleMode;
  77. /**
  78. * The flip mode.
  79. *
  80. * \since This enum is available since SDL 3.0.0.
  81. */
  82. typedef enum SDL_FlipMode
  83. {
  84. SDL_FLIP_NONE, /**< Do not flip */
  85. SDL_FLIP_HORIZONTAL, /**< flip horizontally */
  86. SDL_FLIP_VERTICAL /**< flip vertically */
  87. } SDL_FlipMode;
  88. /**
  89. * A collection of pixels used in software blitting.
  90. *
  91. * Pixels are arranged in memory in rows, with the top row first. Each row
  92. * occupies an amount of memory given by the pitch (sometimes known as the row
  93. * stride in non-SDL APIs).
  94. *
  95. * Within each row, pixels are arranged from left to right until the width is
  96. * reached. Each pixel occupies a number of bits appropriate for its format,
  97. * with most formats representing each pixel as one or more whole bytes (in
  98. * some indexed formats, instead multiple pixels are packed into each byte),
  99. * and a byte order given by the format. After encoding all pixels, any
  100. * remaining bytes to reach the pitch are used as padding to reach a desired
  101. * alignment, and have undefined contents.
  102. *
  103. * \since This struct is available since SDL 3.0.0.
  104. */
  105. typedef struct SDL_Surface
  106. {
  107. SDL_SurfaceFlags flags; /**< Read-only */
  108. SDL_PixelFormat *format; /**< Read-only */
  109. int w, h; /**< Read-only */
  110. int pitch; /**< Read-only */
  111. void *pixels; /**< Read-write */
  112. void *reserved; /**< Private */
  113. /** information needed for surfaces requiring locks */
  114. int locked; /**< Read-only */
  115. /** list of BlitMap that hold a reference to this surface */
  116. void *list_blitmap; /**< Private */
  117. /** clipping information */
  118. SDL_Rect clip_rect; /**< Read-only */
  119. /** info for fast blit mapping to other surfaces */
  120. SDL_BlitMap *map; /**< Private */
  121. /** Reference count -- used when freeing surface */
  122. int refcount; /**< Read-mostly */
  123. } SDL_Surface;
  124. /**
  125. * Allocate a new RGB surface with a specific pixel format.
  126. *
  127. * \param width the width of the surface
  128. * \param height the height of the surface
  129. * \param format the SDL_PixelFormatEnum for the new surface's pixel format.
  130. * \returns the new SDL_Surface structure that is created or NULL if it fails;
  131. * call SDL_GetError() for more information.
  132. *
  133. * \since This function is available since SDL 3.0.0.
  134. *
  135. * \sa SDL_CreateSurfaceFrom
  136. * \sa SDL_DestroySurface
  137. */
  138. extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface(int width, int height, SDL_PixelFormatEnum format);
  139. /**
  140. * Allocate a new RGB surface with a specific pixel format and existing pixel
  141. * data.
  142. *
  143. * No copy is made of the pixel data. Pixel data is not managed automatically;
  144. * you must free the surface before you free the pixel data.
  145. *
  146. * Pitch is the offset in bytes from one row of pixels to the next, e.g.
  147. * `width*4` for `SDL_PIXELFORMAT_RGBA8888`.
  148. *
  149. * You may pass NULL for pixels and 0 for pitch to create a surface that you
  150. * will fill in with valid values later.
  151. *
  152. * \param pixels a pointer to existing pixel data
  153. * \param width the width of the surface
  154. * \param height the height of the surface
  155. * \param pitch the number of bytes between each row, including padding
  156. * \param format the SDL_PixelFormatEnum for the new surface's pixel format.
  157. * \returns the new SDL_Surface structure that is created or NULL if it fails;
  158. * call SDL_GetError() for more information.
  159. *
  160. * \since This function is available since SDL 3.0.0.
  161. *
  162. * \sa SDL_CreateSurface
  163. * \sa SDL_DestroySurface
  164. */
  165. extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurfaceFrom(void *pixels, int width, int height, int pitch, SDL_PixelFormatEnum format);
  166. /**
  167. * Free an RGB surface.
  168. *
  169. * It is safe to pass NULL to this function.
  170. *
  171. * \param surface the SDL_Surface to free.
  172. *
  173. * \since This function is available since SDL 3.0.0.
  174. *
  175. * \sa SDL_CreateSurface
  176. * \sa SDL_CreateSurfaceFrom
  177. */
  178. extern DECLSPEC void SDLCALL SDL_DestroySurface(SDL_Surface *surface);
  179. /**
  180. * Get the properties associated with a surface.
  181. *
  182. * The following properties are understood by SDL:
  183. *
  184. * - `SDL_PROP_SURFACE_COLORSPACE_NUMBER`: an SDL_ColorSpace value describing
  185. * the surface colorspace, defaults to SDL_COLORSPACE_SRGB_LINEAR for
  186. * floating point formats, SDL_COLORSPACE_HDR10 for 10-bit formats,
  187. * SDL_COLORSPACE_SRGB for other RGB surfaces and SDL_COLORSPACE_BT709_FULL
  188. * for YUV surfaces.
  189. * - `SDL_PROP_SURFACE_SDR_WHITE_POINT_FLOAT`: for HDR10 and floating point
  190. * surfaces, this defines the value of 100% diffuse white, with higher
  191. * values being displayed in the High Dynamic Range headroom. This defaults
  192. * to 203 for HDR10 surfaces and 1.0 for floating point surfaces.
  193. * - `SDL_PROP_SURFACE_HDR_HEADROOM_FLOAT`: for HDR10 and floating point
  194. * surfaces, this defines the maximum dynamic range used by the content, in
  195. * terms of the SDR white point. This defaults to 0.0, which disables tone
  196. * mapping.
  197. * - `SDL_PROP_SURFACE_TONEMAP_OPERATOR_STRING`: the tone mapping operator
  198. * used when compressing from a surface with high dynamic range to another
  199. * with lower dynamic range. Currently this supports "chrome", which uses
  200. * the same tone mapping that Chrome uses for HDR content, the form "*=N",
  201. * where N is a floating point scale factor applied in linear space, and
  202. * "none", which disables tone mapping. This defaults to "chrome".
  203. *
  204. * \param surface the SDL_Surface structure to query
  205. * \returns a valid property ID on success or 0 on failure; call
  206. * SDL_GetError() for more information.
  207. *
  208. * \since This function is available since SDL 3.0.0.
  209. *
  210. * \sa SDL_GetProperty
  211. * \sa SDL_SetProperty
  212. */
  213. extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surface *surface);
  214. #define SDL_PROP_SURFACE_COLORSPACE_NUMBER "SDL.surface.colorspace"
  215. #define SDL_PROP_SURFACE_SDR_WHITE_POINT_FLOAT "SDL.surface.SDR_white_point"
  216. #define SDL_PROP_SURFACE_HDR_HEADROOM_FLOAT "SDL.surface.HDR_headroom"
  217. #define SDL_PROP_SURFACE_TONEMAP_OPERATOR_STRING "SDL.surface.tonemap"
  218. /**
  219. * Set the colorspace used by a surface.
  220. *
  221. * Setting the colorspace doesn't change the pixels, only how they are
  222. * interpreted in color operations.
  223. *
  224. * \param surface the SDL_Surface structure to update
  225. * \param colorspace an SDL_ColorSpace value describing the surface colorspace
  226. * \returns 0 on success or a negative error code on failure; call
  227. * SDL_GetError() for more information.
  228. *
  229. * \since This function is available since SDL 3.0.0.
  230. */
  231. extern DECLSPEC int SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace);
  232. /**
  233. * Get the colorspace used by a surface.
  234. *
  235. * The colorspace defaults to SDL_COLORSPACE_SRGB_LINEAR for floating point
  236. * formats, SDL_COLORSPACE_HDR10 for 10-bit formats, SDL_COLORSPACE_SRGB for
  237. * other RGB surfaces and SDL_COLORSPACE_BT709_FULL for YUV textures.
  238. *
  239. * \param surface the SDL_Surface structure to query
  240. * \param colorspace a pointer filled in with an SDL_ColorSpace value
  241. * describing the surface colorspace
  242. * \returns 0 on success or a negative error code on failure; call
  243. * SDL_GetError() for more information.
  244. *
  245. * \since This function is available since SDL 3.0.0.
  246. */
  247. extern DECLSPEC int SDLCALL SDL_GetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace *colorspace);
  248. /**
  249. * Set the palette used by a surface.
  250. *
  251. * A single palette can be shared with many surfaces.
  252. *
  253. * \param surface the SDL_Surface structure to update
  254. * \param palette the SDL_Palette structure to use
  255. * \returns 0 on success or a negative error code on failure; call
  256. * SDL_GetError() for more information.
  257. *
  258. * \since This function is available since SDL 3.0.0.
  259. */
  260. extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette);
  261. /**
  262. * Set up a surface for directly accessing the pixels.
  263. *
  264. * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write to
  265. * and read from `surface->pixels`, using the pixel format stored in
  266. * `surface->format`. Once you are done accessing the surface, you should use
  267. * SDL_UnlockSurface() to release it.
  268. *
  269. * Not all surfaces require locking. If `SDL_MUSTLOCK(surface)` evaluates to
  270. * 0, then you can read and write to the surface at any time, and the pixel
  271. * format of the surface will not change.
  272. *
  273. * \param surface the SDL_Surface structure to be locked
  274. * \returns 0 on success or a negative error code on failure; call
  275. * SDL_GetError() for more information.
  276. *
  277. * \since This function is available since SDL 3.0.0.
  278. *
  279. * \sa SDL_MUSTLOCK
  280. * \sa SDL_UnlockSurface
  281. */
  282. extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface);
  283. /**
  284. * Release a surface after directly accessing the pixels.
  285. *
  286. * \param surface the SDL_Surface structure to be unlocked
  287. *
  288. * \since This function is available since SDL 3.0.0.
  289. *
  290. * \sa SDL_LockSurface
  291. */
  292. extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
  293. /**
  294. * Load a BMP image from a seekable SDL data stream.
  295. *
  296. * The new surface should be freed with SDL_DestroySurface(). Not doing so
  297. * will result in a memory leak.
  298. *
  299. * \param src the data stream for the surface
  300. * \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning,
  301. * even in the case of an error
  302. * \returns a pointer to a new SDL_Surface structure or NULL if there was an
  303. * error; call SDL_GetError() for more information.
  304. *
  305. * \since This function is available since SDL 3.0.0.
  306. *
  307. * \sa SDL_DestroySurface
  308. * \sa SDL_LoadBMP
  309. * \sa SDL_SaveBMP_IO
  310. */
  311. extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio);
  312. /**
  313. * Load a BMP image from a file.
  314. *
  315. * The new surface should be freed with SDL_DestroySurface(). Not doing so
  316. * will result in a memory leak.
  317. *
  318. * \param file the BMP file to load
  319. * \returns a pointer to a new SDL_Surface structure or NULL if there was an
  320. * error; call SDL_GetError() for more information.
  321. *
  322. * \since This function is available since SDL 3.0.0.
  323. *
  324. * \sa SDL_DestroySurface
  325. * \sa SDL_LoadBMP_IO
  326. * \sa SDL_SaveBMP
  327. */
  328. extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP(const char *file);
  329. /**
  330. * Save a surface to a seekable SDL data stream in BMP format.
  331. *
  332. * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
  333. * BMP directly. Other RGB formats with 8-bit or higher get converted to a
  334. * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
  335. * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
  336. * not supported.
  337. *
  338. * \param surface the SDL_Surface structure containing the image to be saved
  339. * \param dst a data stream to save to
  340. * \param closeio if SDL_TRUE, calls SDL_CloseIO() on `dst` before returning,
  341. * even in the case of an error
  342. * \returns 0 on success or a negative error code on failure; call
  343. * SDL_GetError() for more information.
  344. *
  345. * \since This function is available since SDL 3.0.0.
  346. *
  347. * \sa SDL_LoadBMP_IO
  348. * \sa SDL_SaveBMP
  349. */
  350. extern DECLSPEC int SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio);
  351. /**
  352. * Save a surface to a file.
  353. *
  354. * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
  355. * BMP directly. Other RGB formats with 8-bit or higher get converted to a
  356. * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
  357. * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
  358. * not supported.
  359. *
  360. * \param surface the SDL_Surface structure containing the image to be saved
  361. * \param file a file to save to
  362. * \returns 0 on success or a negative error code on failure; call
  363. * SDL_GetError() for more information.
  364. *
  365. * \since This function is available since SDL 3.0.0.
  366. *
  367. * \sa SDL_LoadBMP
  368. * \sa SDL_SaveBMP_IO
  369. */
  370. extern DECLSPEC int SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *file);
  371. /**
  372. * Set the RLE acceleration hint for a surface.
  373. *
  374. * If RLE is enabled, color key and alpha blending blits are much faster, but
  375. * the surface must be locked before directly accessing the pixels.
  376. *
  377. * \param surface the SDL_Surface structure to optimize
  378. * \param flag 0 to disable, non-zero to enable RLE acceleration
  379. * \returns 0 on success or a negative error code on failure; call
  380. * SDL_GetError() for more information.
  381. *
  382. * \since This function is available since SDL 3.0.0.
  383. *
  384. * \sa SDL_BlitSurface
  385. * \sa SDL_LockSurface
  386. * \sa SDL_UnlockSurface
  387. */
  388. extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, int flag);
  389. /**
  390. * Returns whether the surface is RLE enabled.
  391. *
  392. * It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
  393. *
  394. * \param surface the SDL_Surface structure to query
  395. * \returns SDL_TRUE if the surface is RLE enabled, SDL_FALSE otherwise.
  396. *
  397. * \since This function is available since SDL 3.0.0.
  398. *
  399. * \sa SDL_SetSurfaceRLE
  400. */
  401. extern DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
  402. /**
  403. * Set the color key (transparent pixel) in a surface.
  404. *
  405. * The color key defines a pixel value that will be treated as transparent in
  406. * a blit. For example, one can use this to specify that cyan pixels should be
  407. * considered transparent, and therefore not rendered.
  408. *
  409. * It is a pixel of the format used by the surface, as generated by
  410. * SDL_MapRGB().
  411. *
  412. * RLE acceleration can substantially speed up blitting of images with large
  413. * horizontal runs of transparent pixels. See SDL_SetSurfaceRLE() for details.
  414. *
  415. * \param surface the SDL_Surface structure to update
  416. * \param flag SDL_TRUE to enable color key, SDL_FALSE to disable color key
  417. * \param key the transparent pixel
  418. * \returns 0 on success or a negative error code on failure; call
  419. * SDL_GetError() for more information.
  420. *
  421. * \since This function is available since SDL 3.0.0.
  422. *
  423. * \sa SDL_GetSurfaceColorKey
  424. * \sa SDL_SurfaceHasColorKey
  425. */
  426. extern DECLSPEC int SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, int flag, Uint32 key);
  427. /**
  428. * Returns whether the surface has a color key.
  429. *
  430. * It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
  431. *
  432. * \param surface the SDL_Surface structure to query
  433. * \returns SDL_TRUE if the surface has a color key, SDL_FALSE otherwise.
  434. *
  435. * \since This function is available since SDL 3.0.0.
  436. *
  437. * \sa SDL_SetSurfaceColorKey
  438. * \sa SDL_GetSurfaceColorKey
  439. */
  440. extern DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface);
  441. /**
  442. * Get the color key (transparent pixel) for a surface.
  443. *
  444. * The color key is a pixel of the format used by the surface, as generated by
  445. * SDL_MapRGB().
  446. *
  447. * If the surface doesn't have color key enabled this function returns -1.
  448. *
  449. * \param surface the SDL_Surface structure to query
  450. * \param key a pointer filled in with the transparent pixel
  451. * \returns 0 on success or a negative error code on failure; call
  452. * SDL_GetError() for more information.
  453. *
  454. * \since This function is available since SDL 3.0.0.
  455. *
  456. * \sa SDL_SetSurfaceColorKey
  457. * \sa SDL_SurfaceHasColorKey
  458. */
  459. extern DECLSPEC int SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key);
  460. /**
  461. * Set an additional color value multiplied into blit operations.
  462. *
  463. * When this surface is blitted, during the blit operation each source color
  464. * channel is modulated by the appropriate color value according to the
  465. * following formula:
  466. *
  467. * `srcC = srcC * (color / 255)`
  468. *
  469. * \param surface the SDL_Surface structure to update
  470. * \param r the red color value multiplied into blit operations
  471. * \param g the green color value multiplied into blit operations
  472. * \param b the blue color value multiplied into blit operations
  473. * \returns 0 on success or a negative error code on failure; call
  474. * SDL_GetError() for more information.
  475. *
  476. * \since This function is available since SDL 3.0.0.
  477. *
  478. * \sa SDL_GetSurfaceColorMod
  479. * \sa SDL_SetSurfaceAlphaMod
  480. */
  481. extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b);
  482. /**
  483. * Get the additional color value multiplied into blit operations.
  484. *
  485. * \param surface the SDL_Surface structure to query
  486. * \param r a pointer filled in with the current red color value
  487. * \param g a pointer filled in with the current green color value
  488. * \param b a pointer filled in with the current blue color value
  489. * \returns 0 on success or a negative error code on failure; call
  490. * SDL_GetError() for more information.
  491. *
  492. * \since This function is available since SDL 3.0.0.
  493. *
  494. * \sa SDL_GetSurfaceAlphaMod
  495. * \sa SDL_SetSurfaceColorMod
  496. */
  497. extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b);
  498. /**
  499. * Set an additional alpha value used in blit operations.
  500. *
  501. * When this surface is blitted, during the blit operation the source alpha
  502. * value is modulated by this alpha value according to the following formula:
  503. *
  504. * `srcA = srcA * (alpha / 255)`
  505. *
  506. * \param surface the SDL_Surface structure to update
  507. * \param alpha the alpha value multiplied into blit operations
  508. * \returns 0 on success or a negative error code on failure; call
  509. * SDL_GetError() for more information.
  510. *
  511. * \since This function is available since SDL 3.0.0.
  512. *
  513. * \sa SDL_GetSurfaceAlphaMod
  514. * \sa SDL_SetSurfaceColorMod
  515. */
  516. extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha);
  517. /**
  518. * Get the additional alpha value used in blit operations.
  519. *
  520. * \param surface the SDL_Surface structure to query
  521. * \param alpha a pointer filled in with the current alpha value
  522. * \returns 0 on success or a negative error code on failure; call
  523. * SDL_GetError() for more information.
  524. *
  525. * \since This function is available since SDL 3.0.0.
  526. *
  527. * \sa SDL_GetSurfaceColorMod
  528. * \sa SDL_SetSurfaceAlphaMod
  529. */
  530. extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha);
  531. /**
  532. * Set the blend mode used for blit operations.
  533. *
  534. * To copy a surface to another surface (or texture) without blending with the
  535. * existing data, the blendmode of the SOURCE surface should be set to
  536. * `SDL_BLENDMODE_NONE`.
  537. *
  538. * \param surface the SDL_Surface structure to update
  539. * \param blendMode the SDL_BlendMode to use for blit blending
  540. * \returns 0 on success or a negative error code on failure; call
  541. * SDL_GetError() for more information.
  542. *
  543. * \since This function is available since SDL 3.0.0.
  544. *
  545. * \sa SDL_GetSurfaceBlendMode
  546. */
  547. extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode);
  548. /**
  549. * Get the blend mode used for blit operations.
  550. *
  551. * \param surface the SDL_Surface structure to query
  552. * \param blendMode a pointer filled in with the current SDL_BlendMode
  553. * \returns 0 on success or a negative error code on failure; call
  554. * SDL_GetError() for more information.
  555. *
  556. * \since This function is available since SDL 3.0.0.
  557. *
  558. * \sa SDL_SetSurfaceBlendMode
  559. */
  560. extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode);
  561. /**
  562. * Set the clipping rectangle for a surface.
  563. *
  564. * When `surface` is the destination of a blit, only the area within the clip
  565. * rectangle is drawn into.
  566. *
  567. * Note that blits are automatically clipped to the edges of the source and
  568. * destination surfaces.
  569. *
  570. * \param surface the SDL_Surface structure to be clipped
  571. * \param rect the SDL_Rect structure representing the clipping rectangle, or
  572. * NULL to disable clipping
  573. * \returns SDL_TRUE if the rectangle intersects the surface, otherwise
  574. * SDL_FALSE and blits will be completely clipped.
  575. *
  576. * \since This function is available since SDL 3.0.0.
  577. *
  578. * \sa SDL_GetSurfaceClipRect
  579. */
  580. extern DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect);
  581. /**
  582. * Get the clipping rectangle for a surface.
  583. *
  584. * When `surface` is the destination of a blit, only the area within the clip
  585. * rectangle is drawn into.
  586. *
  587. * \param surface the SDL_Surface structure representing the surface to be
  588. * clipped
  589. * \param rect an SDL_Rect structure filled in with the clipping rectangle for
  590. * the surface
  591. * \returns 0 on success or a negative error code on failure; call
  592. * SDL_GetError() for more information.
  593. *
  594. * \since This function is available since SDL 3.0.0.
  595. *
  596. * \sa SDL_SetSurfaceClipRect
  597. */
  598. extern DECLSPEC int SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect);
  599. /**
  600. * Flip a surface vertically or horizontally.
  601. *
  602. * \param surface the surface to flip
  603. * \param flip the direction to flip
  604. * \returns 0 on success or a negative error code on failure; call
  605. * SDL_GetError() for more information.
  606. *
  607. * \since This function is available since SDL 3.0.0.
  608. */
  609. extern DECLSPEC int SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);
  610. /**
  611. * Creates a new surface identical to the existing surface.
  612. *
  613. * The returned surface should be freed with SDL_DestroySurface().
  614. *
  615. * \param surface the surface to duplicate.
  616. * \returns a copy of the surface, or NULL on failure; call SDL_GetError() for
  617. * more information.
  618. *
  619. * \since This function is available since SDL 3.0.0.
  620. *
  621. * \sa SDL_DestroySurface
  622. */
  623. extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface *surface);
  624. /**
  625. * Copy an existing surface to a new surface of the specified format.
  626. *
  627. * This function is used to optimize images for faster *repeat* blitting. This
  628. * is accomplished by converting the original and storing the result as a new
  629. * surface. The new, optimized surface can then be used as the source for
  630. * future blits, making them faster.
  631. *
  632. * \param surface the existing SDL_Surface structure to convert
  633. * \param format the SDL_PixelFormat structure that the new surface is
  634. * optimized for
  635. * \returns the new SDL_Surface structure that is created or NULL if it fails;
  636. * call SDL_GetError() for more information.
  637. *
  638. * \since This function is available since SDL 3.0.0.
  639. *
  640. * \sa SDL_ConvertSurfaceFormat
  641. * \sa SDL_ConvertSurfaceFormatAndColorspace
  642. * \sa SDL_CreatePixelFormat
  643. * \sa SDL_DestroySurface
  644. */
  645. extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *format);
  646. /**
  647. * Copy an existing surface to a new surface of the specified format.
  648. *
  649. * This function operates just like SDL_ConvertSurface(), but accepts an
  650. * SDL_PixelFormatEnum value instead of an SDL_PixelFormat structure. As such,
  651. * it might be easier to call but it doesn't have access to palette
  652. * information for the destination surface, in case that would be important.
  653. *
  654. * \param surface the existing SDL_Surface structure to convert
  655. * \param pixel_format the new pixel format
  656. * \returns the new SDL_Surface structure that is created or NULL if it fails;
  657. * call SDL_GetError() for more information.
  658. *
  659. * \since This function is available since SDL 3.0.0.
  660. *
  661. * \sa SDL_ConvertSurface
  662. * \sa SDL_ConvertSurfaceFormatAndColorspace
  663. * \sa SDL_DestroySurface
  664. */
  665. extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat(SDL_Surface *surface, SDL_PixelFormatEnum pixel_format);
  666. /**
  667. * Copy an existing surface to a new surface of the specified format and
  668. * colorspace.
  669. *
  670. * This function converts an existing surface to a new format and colorspace
  671. * and returns the new surface. This will perform any pixel format and
  672. * colorspace conversion needed.
  673. *
  674. * \param surface the existing SDL_Surface structure to convert
  675. * \param pixel_format the new pixel format
  676. * \param colorspace the new colorspace
  677. * \param props an SDL_PropertiesID with additional color properties, or 0
  678. * \returns the new SDL_Surface structure that is created or NULL if it fails;
  679. * call SDL_GetError() for more information.
  680. *
  681. * \since This function is available since SDL 3.0.0.
  682. *
  683. * \sa SDL_ConvertSurface
  684. * \sa SDL_ConvertSurfaceFormat
  685. * \sa SDL_DestroySurface
  686. */
  687. extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormatAndColorspace(SDL_Surface *surface, SDL_PixelFormatEnum pixel_format, SDL_Colorspace colorspace, SDL_PropertiesID props);
  688. /**
  689. * Copy a block of pixels of one format to another format.
  690. *
  691. * \param width the width of the block to copy, in pixels
  692. * \param height the height of the block to copy, in pixels
  693. * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
  694. * \param src a pointer to the source pixels
  695. * \param src_pitch the pitch of the source pixels, in bytes
  696. * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
  697. * \param dst a pointer to be filled in with new pixel data
  698. * \param dst_pitch the pitch of the destination pixels, in bytes
  699. * \returns 0 on success or a negative error code on failure; call
  700. * SDL_GetError() for more information.
  701. *
  702. * \since This function is available since SDL 3.0.0.
  703. *
  704. * \sa SDL_ConvertPixelsAndColorspace
  705. */
  706. extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, SDL_PixelFormatEnum src_format, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch);
  707. /**
  708. * Copy a block of pixels of one format and colorspace to another format and
  709. * colorspace.
  710. *
  711. * \param width the width of the block to copy, in pixels
  712. * \param height the height of the block to copy, in pixels
  713. * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
  714. * \param src_colorspace an SDL_ColorSpace value describing the colorspace of
  715. * the `src` pixels
  716. * \param src_properties an SDL_PropertiesID with additional source color
  717. * properties, or 0
  718. * \param src a pointer to the source pixels
  719. * \param src_pitch the pitch of the source pixels, in bytes
  720. * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
  721. * \param dst_colorspace an SDL_ColorSpace value describing the colorspace of
  722. * the `dst` pixels
  723. * \param dst_properties an SDL_PropertiesID with additional destination color
  724. * properties, or 0
  725. * \param dst a pointer to be filled in with new pixel data
  726. * \param dst_pitch the pitch of the destination pixels, in bytes
  727. * \returns 0 on success or a negative error code on failure; call
  728. * SDL_GetError() for more information.
  729. *
  730. * \since This function is available since SDL 3.0.0.
  731. *
  732. * \sa SDL_ConvertPixels
  733. */
  734. extern DECLSPEC int SDLCALL SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormatEnum src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch);
  735. /**
  736. * Premultiply the alpha on a block of pixels.
  737. *
  738. * This is safe to use with src == dst, but not for other overlapping areas.
  739. *
  740. * This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888.
  741. *
  742. * \param width the width of the block to convert, in pixels
  743. * \param height the height of the block to convert, in pixels
  744. * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
  745. * \param src a pointer to the source pixels
  746. * \param src_pitch the pitch of the source pixels, in bytes
  747. * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
  748. * \param dst a pointer to be filled in with premultiplied pixel data
  749. * \param dst_pitch the pitch of the destination pixels, in bytes
  750. * \returns 0 on success or a negative error code on failure; call
  751. * SDL_GetError() for more information.
  752. *
  753. * \since This function is available since SDL 3.0.0.
  754. */
  755. extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormatEnum src_format, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch);
  756. /**
  757. * Perform a fast fill of a rectangle with a specific color.
  758. *
  759. * `color` should be a pixel of the format used by the surface, and can be
  760. * generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an
  761. * alpha component then the destination is simply filled with that alpha
  762. * information, no blending takes place.
  763. *
  764. * If there is a clip rectangle set on the destination (set via
  765. * SDL_SetSurfaceClipRect()), then this function will fill based on the
  766. * intersection of the clip rectangle and `rect`.
  767. *
  768. * \param dst the SDL_Surface structure that is the drawing target
  769. * \param rect the SDL_Rect structure representing the rectangle to fill, or
  770. * NULL to fill the entire surface
  771. * \param color the color to fill with
  772. * \returns 0 on success or a negative error code on failure; call
  773. * SDL_GetError() for more information.
  774. *
  775. * \since This function is available since SDL 3.0.0.
  776. *
  777. * \sa SDL_FillSurfaceRects
  778. */
  779. extern DECLSPEC int SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color);
  780. /**
  781. * Perform a fast fill of a set of rectangles with a specific color.
  782. *
  783. * `color` should be a pixel of the format used by the surface, and can be
  784. * generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an
  785. * alpha component then the destination is simply filled with that alpha
  786. * information, no blending takes place.
  787. *
  788. * If there is a clip rectangle set on the destination (set via
  789. * SDL_SetSurfaceClipRect()), then this function will fill based on the
  790. * intersection of the clip rectangle and `rect`.
  791. *
  792. * \param dst the SDL_Surface structure that is the drawing target
  793. * \param rects an array of SDL_Rects representing the rectangles to fill.
  794. * \param count the number of rectangles in the array
  795. * \param color the color to fill with
  796. * \returns 0 on success or a negative error code on failure; call
  797. * SDL_GetError() for more information.
  798. *
  799. * \since This function is available since SDL 3.0.0.
  800. *
  801. * \sa SDL_FillSurfaceRect
  802. */
  803. extern DECLSPEC int SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color);
  804. /**
  805. * Performs a fast blit from the source surface to the destination surface.
  806. *
  807. * This assumes that the source and destination rectangles are the same size.
  808. * If either `srcrect` or `dstrect` are NULL, the entire surface (`src` or
  809. * `dst`) is copied. The final blit rectangles are saved in `srcrect` and
  810. * `dstrect` after all clipping is performed.
  811. *
  812. * The blit function should not be called on a locked surface.
  813. *
  814. * The blit semantics for surfaces with and without blending and colorkey are
  815. * defined as follows:
  816. *
  817. * ```
  818. * RGBA->RGB:
  819. * Source surface blend mode set to SDL_BLENDMODE_BLEND:
  820. * alpha-blend (using the source alpha-channel and per-surface alpha)
  821. * SDL_SRCCOLORKEY ignored.
  822. * Source surface blend mode set to SDL_BLENDMODE_NONE:
  823. * copy RGB.
  824. * if SDL_SRCCOLORKEY set, only copy the pixels matching the
  825. * RGB values of the source color key, ignoring alpha in the
  826. * comparison.
  827. *
  828. * RGB->RGBA:
  829. * Source surface blend mode set to SDL_BLENDMODE_BLEND:
  830. * alpha-blend (using the source per-surface alpha)
  831. * Source surface blend mode set to SDL_BLENDMODE_NONE:
  832. * copy RGB, set destination alpha to source per-surface alpha value.
  833. * both:
  834. * if SDL_SRCCOLORKEY set, only copy the pixels matching the
  835. * source color key.
  836. *
  837. * RGBA->RGBA:
  838. * Source surface blend mode set to SDL_BLENDMODE_BLEND:
  839. * alpha-blend (using the source alpha-channel and per-surface alpha)
  840. * SDL_SRCCOLORKEY ignored.
  841. * Source surface blend mode set to SDL_BLENDMODE_NONE:
  842. * copy all of RGBA to the destination.
  843. * if SDL_SRCCOLORKEY set, only copy the pixels matching the
  844. * RGB values of the source color key, ignoring alpha in the
  845. * comparison.
  846. *
  847. * RGB->RGB:
  848. * Source surface blend mode set to SDL_BLENDMODE_BLEND:
  849. * alpha-blend (using the source per-surface alpha)
  850. * Source surface blend mode set to SDL_BLENDMODE_NONE:
  851. * copy RGB.
  852. * both:
  853. * if SDL_SRCCOLORKEY set, only copy the pixels matching the
  854. * source color key.
  855. * ```
  856. *
  857. * \param src the SDL_Surface structure to be copied from
  858. * \param srcrect the SDL_Rect structure representing the rectangle to be
  859. * copied, or NULL to copy the entire surface
  860. * \param dst the SDL_Surface structure that is the blit target
  861. * \param dstrect the SDL_Rect structure representing the x and y position in
  862. * the destination surface. On input the width and height are
  863. * ignored (taken from srcrect), and on output this is filled
  864. * in with the actual rectangle used after clipping.
  865. * \returns 0 on success or a negative error code on failure; call
  866. * SDL_GetError() for more information.
  867. *
  868. * \since This function is available since SDL 3.0.0.
  869. *
  870. * \sa SDL_BlitSurfaceScaled
  871. */
  872. extern DECLSPEC int SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);
  873. /**
  874. * Perform low-level surface blitting only.
  875. *
  876. * This is a semi-private blit function and it performs low-level surface
  877. * blitting, assuming the input rectangles have already been clipped.
  878. *
  879. * \param src the SDL_Surface structure to be copied from
  880. * \param srcrect the SDL_Rect structure representing the rectangle to be
  881. * copied, or NULL to copy the entire surface
  882. * \param dst the SDL_Surface structure that is the blit target
  883. * \param dstrect the SDL_Rect structure representing the target rectangle in
  884. * the destination surface
  885. * \returns 0 on success or a negative error code on failure; call
  886. * SDL_GetError() for more information.
  887. *
  888. * \since This function is available since SDL 3.0.0.
  889. *
  890. * \sa SDL_BlitSurface
  891. */
  892. extern DECLSPEC int SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);
  893. /**
  894. * Perform stretch blit between two surfaces of the same format.
  895. *
  896. * Using SDL_SCALEMODE_NEAREST: fast, low quality. Using SDL_SCALEMODE_LINEAR:
  897. * bilinear scaling, slower, better quality, only 32BPP.
  898. *
  899. * \param src the SDL_Surface structure to be copied from
  900. * \param srcrect the SDL_Rect structure representing the rectangle to be
  901. * copied
  902. * \param dst the SDL_Surface structure that is the blit target
  903. * \param dstrect the SDL_Rect structure representing the target rectangle in
  904. * the destination surface
  905. * \param scaleMode scale algorithm to be used
  906. * \returns 0 on success or a negative error code on failure; call
  907. * SDL_GetError() for more information.
  908. *
  909. * \since This function is available since SDL 3.0.0.
  910. *
  911. * \sa SDL_BlitSurfaceScaled
  912. */
  913. extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
  914. /**
  915. * Perform a scaled blit to a destination surface, which may be of a different
  916. * format.
  917. *
  918. * \param src the SDL_Surface structure to be copied from
  919. * \param srcrect the SDL_Rect structure representing the rectangle to be
  920. * copied
  921. * \param dst the SDL_Surface structure that is the blit target
  922. * \param dstrect the SDL_Rect structure representing the target rectangle in
  923. * the destination surface, filled with the actual rectangle
  924. * used after clipping
  925. * \param scaleMode the SDL_ScaleMode to be used
  926. * \returns 0 on success or a negative error code on failure; call
  927. * SDL_GetError() for more information.
  928. *
  929. * \since This function is available since SDL 3.0.0.
  930. *
  931. * \sa SDL_BlitSurface
  932. */
  933. extern DECLSPEC int SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
  934. /**
  935. * Perform low-level surface scaled blitting only.
  936. *
  937. * This is a semi-private function and it performs low-level surface blitting,
  938. * assuming the input rectangles have already been clipped.
  939. *
  940. * \param src the SDL_Surface structure to be copied from
  941. * \param srcrect the SDL_Rect structure representing the rectangle to be
  942. * copied
  943. * \param dst the SDL_Surface structure that is the blit target
  944. * \param dstrect the SDL_Rect structure representing the target rectangle in
  945. * the destination surface
  946. * \param scaleMode scale algorithm to be used
  947. * \returns 0 on success or a negative error code on failure; call
  948. * SDL_GetError() for more information.
  949. *
  950. * \since This function is available since SDL 3.0.0.
  951. *
  952. * \sa SDL_BlitSurfaceScaled
  953. */
  954. extern DECLSPEC int SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
  955. /**
  956. * Retrieves a single pixel from a surface.
  957. *
  958. * This function prioritizes correctness over speed: it is suitable for unit
  959. * tests, but is not intended for use in a game engine.
  960. *
  961. * Like SDL_GetRGBA, this uses the entire 0..255 range when converting color
  962. * components from pixel formats with less than 8 bits per RGB component.
  963. *
  964. * \param surface the surface to read
  965. * \param x the horizontal coordinate, 0 <= x < width
  966. * \param y the vertical coordinate, 0 <= y < height
  967. * \param r a pointer filled in with the red channel, 0-255, or NULL to ignore
  968. * this channel
  969. * \param g a pointer filled in with the green channel, 0-255, or NULL to
  970. * ignore this channel
  971. * \param b a pointer filled in with the blue channel, 0-255, or NULL to
  972. * ignore this channel
  973. * \param a a pointer filled in with the alpha channel, 0-255, or NULL to
  974. * ignore this channel
  975. * \returns 0 on success or a negative error code on failure; call
  976. * SDL_GetError() for more information.
  977. *
  978. * \since This function is available since SDL 3.0.0.
  979. */
  980. extern DECLSPEC int SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
  981. /* Ends C function definitions when using C++ */
  982. #ifdef __cplusplus
  983. }
  984. #endif
  985. #include <SDL3/SDL_close_code.h>
  986. #endif /* SDL_surface_h_ */