I occasionally find myself needing to render into offscreen buffers of one sort or another. (GUI toolkits, tools, maps in games etc; basically complex stuff that needs small and/or infrequent updates.) The obvious, nice, clean, potentially hardware accelerated solution is to render to textures via SDL_SetRenderTarget() - but that leads to three questions:
When and where can I reasonably expect render target support? (Obviously, I’d prefer not having to implement fallback solutions.)
Is there a less awkward and inefficient way of implementing a software fallback than this?
SDL_LockTexture(...); SDL_CreateRGBSurfaceFrom(...); SDL_CreateSoftwareRenderer(...); render_stuff(); SDL_UnlockTexture(...); clean_up();
Are there design motivations for SDL_SetRenderTarget() failing instead of falling back to software rendering, or is it just a matter of no one needing it enough to implement it? (Applications could still check for hardware acceleration, if they have better solutions than the software fallback.)