SDL3 SDL_Renderer multiviewport fix for non-shared textures (for fonts only)
Very nasty fix for SDL3 not being able to share fonts between renderers, but it works.
Though i think this needs better solution, pointer comparing isn't the best approach
SDL_Texture * tex = (SDL_Texture*)pcmd->GetTexID();
if (tex == bd->FontTexture)
{
if (texture != nullptr)
{
tex = texture;
}
}
This is probably reliant on certain backend and os and is unlikely to work with all of them supported by SDL.
This is probably reliant on certain backend and os and is unlikely to work with all of them supported by SDL.
It might be, also after doing some research i found out that there is ways to copy the textures between renderers rather than recreating them.
Though SDL3 still to this date does not support sharing textures between 2 different SDL_Renderer instances without any extra code. So something needs to be done about it.
It’s well known what needs to be done, but SDL Renderer for some backends creates one device per renderer making the textures non sharable. See my link https://github.com/ocornut/imgui/issues/7675#issuecomment-2156454617 I can tell your PR isn’t going to work accross multiple renderers.