SDL_Vertex(3type)
π SDL_Vertex π
okay bestie, welcome to the SDL3 DATATYPES corner of the manual, and today's main character is SDL_Vertex(3type) β the vertex structure. it's giving tiny-but-powerful. it's giving "three little fields that make a whole shape happen". slay.
β¨ NAME β¨
SDL_Vertex β the Vertex structure. that's it, that's the whole name. short, sweet, iconic. π
πΈ SYNOPSIS πΈ
first things first, you gotta pull in the header:
#include <SDL3/SDL_render.h>
and then, boom, here's the whole struct, exactly as it lives, no cap:
typedef struct SDL_Vertex
{
SDL_FPoint position; /**< Vertex position, in SDL_Renderer coordinates */
SDL_FColor color; /**< Vertex color */
SDL_FPoint tex_coord; /**< Normalized texture coordinates, if needed */
} SDL_Vertex;
so let's break down the trio, because each field is doing its own lil job:
positionβ anSDL_FPointthat holds where this vertex actually sits, measured inSDL_Renderercoordinates. that's the whole "where am I" of it. πcolorβ anSDL_FColorfor the vertex color. yes bestie, per-vertex color, we love to see it. π¨tex_coordβ anSDL_FPointwith the normalized texture coordinates, if needed. note the "if needed" β it's optional energy, don't stress if you're not texturing anything. π¦
π AVAILABILITY π
this struct has been around since SDL 3.2.0. so if you're on anything older than that... yeah, no vertex for you, sorry bestie. π
and that's the whole page, periodt. this lil rewrite was brought to you by the good folks over at Simple Directmedia Layer, rockin' SDL 3.4.18, and yes, SDL_Vertex(3type) is officially a 3type. go forth and render something gorgeous, i'm obsessed. π«Άβ¨π
π¦ 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