SDL_CreateSoftwareRenderer(3)

πŸ’– SDL_CreateSoftwareRenderer πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_CreateSoftwareRenderer πŸŽ€

✨ NAME ✨

SDL_CreateSoftwareRenderer β€” make a 2D software rendering context for a surface πŸ¦‹


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_render.h>

SDL_Renderer * SDL_CreateSoftwareRenderer(SDL_Surface *surface);

πŸ’… DESCRIPTION πŸ’…

so there are literally two other APIs you can use to create an SDL_Renderer: SDL_CreateRenderer() and SDL_CreateWindowAndRenderer(). and yes, those can also make a software renderer, no cap β€” but they're intended to be used with an SDL_Window as the final destination, not an SDL_Surface. so if a surface is your whole vibe, this is the function for you. iykyk πŸ’–


🫢 FUNCTION PARAMETERS 🫢

  • surface β€” the SDL_Surface structure representing the surface where rendering is done. that's the canvas, bestie. that's where the art happens 🎨

⭐ RETURN VALUE ⭐

returns a valid rendering context, or NULL if there was an error 😭 (yes, the sad NULL). call SDL_GetError() for more info β€” she will tell you what went wrong, fr fr.


🧚 THREAD SAFETY 🧚

it is safe to call this function from any thread. every thread is invited to the party πŸŽ‰ periodt.


🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0 ✨


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, no notes. this little legend comes to you from the Simple Directmedia Layer era, specifically SDL 3.4.18, and yes the page itself is SDL_CreateSoftwareRenderer(3) 🫢 go make something cute with it, bestie πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from