I'm working on porting a game from SDL 1.2 to SDL 2, and ran into a couple of problems that I'm apparently resolve on my own:
I can't get the texture + software rendering + alpha blending combo work. The symptoms are that described in bug 2198 (https://bugzilla.libsdl.org/show_bug.cgi?id=2198), except that I can't get good results with SDL_RenderCopy either. I'd assume this is an SDL2 bug, but the docs claim that some blend modes won't work on all renderers... so I hope this is a bug and not intended behavior?
I'm admittedly inexperienced with low-level graphics concepts and algorithms, so it might be only my ignorance that I can't make sense of the formula used for color modulating. We would mainly use this feature to draw a layer of a certain color over an image, but that's not really possible with the src * (mod / 255) formula, partly because its effects depend on the value of the color channel and partly because, mod being an Uint8, it can't be used for brightening. So, I ask, is it possible to achieve an effect like dst = src + mod (even by possibly patching SDL2 on my own)? I thought about rendering a semi-transparent colored rectangle onto the texture, but the remarks section of SDL_SetRenderTarget implies that this is probably not a widely supported feature, and our software is supposed
to run on a very broad variety of platforms.
My last issue is with scaling textures. The best platform-independent algorithm, linear filtering, is still largely inferior to the bilinear interpolation algorithm that we use right now. My question is the same as with color modulation: is this something that can be fixed in SDL2 with a patch, or it's an inherent feature of OGL/D3D?
Thanks in advance![/url]