SDL_RenderGeometry(3)
π SDL_RenderGeometry(3) β the SDL3 glow-up page
okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, where we're talking about SDL_RenderGeometry, and honestly? she's iconic. this is the one that draws a whole list of triangles for you, optionally with a texture, and optionally with indices pointing into your vertex array. and the kicker: color and alpha modulation happen per vertex, which means SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are justβ¦ ignored here. not invited to the party. π
β¨ NAME β¨
SDL_RenderGeometry β Render a list of triangles, optionally using a texture and indices into the vertex array. Color and alpha modulation is done per vertex (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).
π SYNOPSIS π
#include <SDL3/SDL_render.h>
bool SDL_RenderGeometry(SDL_Renderer *renderer,
SDL_Texture *texture,
const SDL_Vertex *vertices, int num_vertices,
const int *indices, int num_indices);
πΈ FUNCTION PARAMETERS πΈ
rendererβ the rendering context. your main character, the canvas holder, the one who does the actual drawing. π¨textureβ (optional) the SDL texture to use. optional bestie, so if you don't need one, don't bring one.verticesβ vertices. yeah. the actual points. the geometry. the whole reason we're here. πnum_verticesβ number of vertices. count 'em.indicesβ (optional) an array of integer indices into theverticesarray. if it'sNULL, all vertices will be rendered in sequential order β no skipping, no shuffling, just straight down the line. πΆβοΈnum_indicesβ number of indices. again, count 'em. π’
π RETURN VALUE π
Returns true on success or false on failure. and if it fails, don't just sit there confused β call SDL_GetError() for more information. she'll tell you what went wrong, i promise. π«Ά
π§΅ THREAD SAFETY π§΅
This function should only be called on the main thread. no off-thread shenanigans. main thread only, periodt. π«
π AVAILABILITY π
This function is available since SDL 3.2.0. so if you're on something older, that's a you problem, bestie, go update. β¨
π SEE ALSO π
go read those too, iykyk. π
and that's the whole vibe check, fr fr. this page came to you from Simple Directmedia Layer, version SDL 3.4.18, and it's the SDL_RenderGeometry(3) page β slay, bye π
π¦πΈ
π¦ 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