implement SDL2 backend, use it by default
commit56de33357e29bb67b84f5249327f1c45dc1c2815
authorrofl0r <rofl0r@users.noreply.github.com>
Wed, 1 Sep 2021 05:13:22 +0000 (1 05:13 +0000)
committerrofl0r <rofl0r@users.noreply.github.com>
Wed, 1 Sep 2021 05:13:22 +0000 (1 05:13 +0000)
tree79f8abe744abe754fcb3a91bdc7655b66c39a950
parent64d6610adeb4aba35fe2a7defc87aee85d3f49b1
implement SDL2 backend, use it by default

for some reason my software renderer in X11 got really slow, and
rendering at 3x or 4x scale makes emulation speed go to 50%.
this made it necessary to implement SDL2 support as only it supports
OpenGL hardware scaling.

In order to take advantage of hardware scaling, game is rendered
at 1x scale and copied to texture.
unfortunately (or maybe not) that means that none of the existing
software scalers can be used without re-introducing the performance
problem. apparently some of them exist as GPU shaders [0], but
i'm not really interested in these scalers anyway as i don't like
the result.

the spaghetti code in SDL.c is quite ugly and the port took much
longer than expected.

further changes:
- removed possibility to set SGB borders at runtime (you can use
  command line option or config file though)
- improved speed of 1x stretchers by using memcpy() instead
- some cleanups such as using tables instead of huge switch blocks

to build the old SDL 1.2 backend, use make USE_SDL1=1

[0]: https://docs.scummvm.org/en/latest/advanced_topics/understand_graphics.html
Makefile
src/sdl/SDL.c