scummvm/scummvm — pull request #408 by lordhoto (2013-10-07 00:41:11+00:00)
Title: OpenGL revamp

This features a simplified design and also a more sane choice of output "modes". The code should now (hopefully) be (much) easier to maintain than the old one.

The new design follows the logic that subclasses of the generic OpenGLGraphicsManager class should not directly work with its internals. Instead, hooks and/or setters/getters are employed. The members itself are protected by private. I also took some ideas from the iOS and Android port. For example, the new texture wrapper class is based on the Android backend's one which is much cleaner than what we had before. The dirty rect code has been improved too. It does not call glSubTexImage2D horrendously often anymore...

Instead of the old and confusing modes Normal, Conserve and Original which all affected how the game screen was scaled size wise the new backend features a plain OpenGL mode which does bilinear filtering and an OpenGL (no filtering) mode which uses nearest neighbor. The only scale mode is "Cosnerve" which keeps the aspect ratio of the original game screen (aspect ratio correction is still supported of course). This should be much less confusing for the users.

The Tizen port is adapted (and Chris briefly tested the changes). There's one outstanding issue I'm currently discussing with Chris, but that does not affect anything except Tizen.

I played a bit around some games for testing, but overall it could receive more testing.

Things to do:
- Get rid of the horrible HACK in base/. (The issue here is that we need to switch the graphics manager before getSupportedFormats is called. The new OpenGL code supplies a much shorter list of available color formats, the old code would've needed this too in this case. I chose to return less formats so it can be used as a better testing area for OpenGL ES devices (which do not support some modes). I had to add RGB555 for SCUMM HE though :-/)
- More testing.
- Maybe further cleanup (and suggestions are welcome).
- Maybe think of a better way AR/scale factor changes are handled after custom window resizing.
- Add support for taking screenshots