SDL_SetSurfaceRLE(3)
π SDL_SetSurfaceRLE(3) π
okay bestie, welcome to the SDL3 functions corner of the manual, and today's main character is SDL_SetSurfaceRLE β the lil hint-flipper that makes your blits go zoom. no cap. π¦
β¨ NAME β¨
SDL_SetSurfaceRLE β set the RLE acceleration hint for a surface. that's it, that's the whole job, and she does it flawlessly. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_surface.h>
bool SDL_SetSurfaceRLE(SDL_Surface *surface, bool enabled);
π DESCRIPTION π
so here's the tea, fr fr: if RLE is enabled, color key and alpha blending blits are much faster. like, noticeably. iconic behaviour. π₯
BUT. and this is the big BUT, bestie β the surface must be locked before directly accessing the pixels. RLE on means you don't just wander in and start touching pixels with your bare hands. lock first. SDL_LockSurface is right there. π«Ά
π FUNCTION PARAMETERS π
surfaceβ theSDL_Surfacestructure to optimize. yes, this one. your girl. your canvas. πenabledβtrueto enable RLE acceleration,falseto disable it. binary choice, no in-between, very decisive of you. β
π RETURN VALUE π
Returns true on success or false on failure. and if it fails? don't just sit there spiraling β call SDL_GetError() for more information. she'll tell you what went wrong. π
π§ THREAD SAFETY π§
This function can be called on different threads with different surfaces. key word: different. different surfaces, different threads, everybody minding their own business. peaceful. serene. no drama. β¨
π AVAILABILITY π
This function is available since SDL 3.2.0. so if you're on something older, it's giving "not yet, babe". π
πΈ SEE ALSO πΈ
mwah π that's the whole page. go forth, set your RLE hint, lock your surfaces, and slay.
this has been your girl from the Simple Directmedia Layer crew, running SDL 3.4.18, signing off on SDL_SetSurfaceRLE(3) β stay hydrated, lock your pixels, periodt. ππ¦π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms