Description
SDL_RenderGeometryRaw already lets you specify an arbitrary stride for your vertex list.
It would be very useful to allow up to four spatial coordinates to be transmitted to the render backend if the stride is greater than 8 bytes.
Backends which accept up to four spatial coordinates should have the third and fourth coordinate default to zero and one respectively if the user provides a stride of only two coordinates.
SDL should make no additional guarantee or responsibility beyond dumb transmission of the coordinates to the hardware, and the software renderer should do nothing at all with the third and fourth optional coordinate.
Example:
SDL/src/render/opengl/SDL_render_gl.c
Line 963 in e0321ca
SDL/src/render/opengl/SDL_render_gl.c
Lines 994 to 995 in e0321ca
--- size_t sz = 2 * sizeof(GLfloat) + 4 * sizeof(GLfloat) + (texture ? 2 : 0) * sizeof(GLfloat);
+++ size_t sz = 4 * sizeof(GLfloat) + 4 * sizeof(GLfloat) + (texture ? 2 : 0) * sizeof(GLfloat);
*(verts++) = xy_[0] * scale_x;
*(verts++) = xy_[1] * scale_y;
+++ *(verts++) = xy_stride >= 12 ? xy_[2] : 0;
+++ *(verts++) = xy_stride >= 16 ? xy_[3] : 1;