[SDL3.x] SDL_RenderGeometry and transform

Is it possible to write to a kind of texture buffer using SDL_RenderGeometry and then draw it multiple times? The only thing that occurred to me is to set areas using SDL_SetRenderViewport. But then I have to re-render each time.

    SDL_Rect r = {0, 0, 400, 300};
    SDL_SetRenderViewport(renderer, &r);
    SDL_RenderGeometry(renderer, NULL, vert, vertLen, NULL, 0);

    r = {400, 0, 400, 300};
    SDL_SetRenderViewport(renderer, &r);
    SDL_RenderGeometry(renderer, NULL, vert, vertLen, NULL, 0);

If the question is whether you can render to a texture, the answer is yes.

Just pass SDL_TEXTUREACCESS_TARGET as the access argument when creating the texture and use SDL_SetRenderTarget. After that, everything you render will be drawn to the texture instead of the window. When you’re finished, and want to render to the window again, just call SDL_SetRenderTarget(renderer, NULL).

Thanks
From the looks of it, this works similarly to the frame buffer in OpenGL. You can also render to a texture instead of the screen.