win-capture: Add game capture fix for darkest dungeon

Darkest dungeon uses an unusual technique for drawing its frames: a
fixed 1920x1080 frame buffer used in place of the backbuffer, which is
then stretched to fit the size of the screen (whether the screen is
bigger or smaller than the actual texture).

The custom frame would cause glReadBuffer to initially fail with an
error.  When this happens, their custom frame buffer is in use, so all
that needs to be done is simply reset the capture and force the current
output size to 1920x1080 while that custom frame is in use.

They presumably did this in order to ensure the game looks the same at
any resolution.  Instead of having to use power-of-two sprites and
mipmaps for every single game sprite and stretch/skew each of them
(which would risk the final output "not looking quite right" at
different resolutions), they simply use non-pow-2 sprites with no
mipmaps and render them all on to one texture of a fixed size and then
stretch that final output texture.  That ensures that the actual
composite of the game still looks the same at any resolution, while
reducing texture memory by not requiring each sprite to use a
power-of-two texture and mipmaps.
This commit is contained in:
jp9000
2016-01-23 02:47:34 -08:00
parent 7f0f3d25c9
commit 2591f24594
2 changed files with 25 additions and 9 deletions

View File

@@ -22,6 +22,8 @@ typedef ptrdiff_t GLsizeiptrARB;
#define GL_FRONT 0x0404
#define GL_BACK 0x0405
#define GL_INVALID_OPERATION 0x0502
#define GL_UNSIGNED_BYTE 0x1401
#define GL_RGB 0x1907