Clean up OpenGL code and introduce the Framebuffer Manager. More work is forthcoming; I plan to implement resolution switching (while the game is running) and also multiple virtual XFBs for game-controlled buffer swapping.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3587 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Nolan Check
2009-06-28 23:35:08 +00:00
parent fd47eb7b44
commit 07a767691d
7 changed files with 357 additions and 246 deletions

View File

@ -414,7 +414,7 @@ void Video_AddMessage(const char* pstr, u32 milliseconds)
}
// TODO: Protect this structure with a mutex.
static volatile struct
{
u8* pXFB;
@ -441,16 +441,18 @@ void Video_UpdateXFB(u8* _pXFB, u32 _dwWidth, u32 _dwHeight, s32 _dwYOffset, boo
{
g_XFBUpdateRequested = FALSE;
if (g_Config.bUseXFB)
if (!_pXFB)
{
if (!_pXFB)
// From graphics thread in DC mode
Renderer::DecodeFromXFB(tUpdateXFBArgs.pXFB, tUpdateXFBArgs.width, tUpdateXFBArgs.height, tUpdateXFBArgs.yOffset);
else
// From CPU in SC mode
Renderer::DecodeFromXFB(_pXFB, _dwWidth, _dwHeight, _dwYOffset);
// From graphics thread in DC mode
_pXFB = tUpdateXFBArgs.pXFB;
_dwWidth = tUpdateXFBArgs.width;
_dwHeight = tUpdateXFBArgs.height;
_dwYOffset = tUpdateXFBArgs.yOffset;
}
if (g_Config.bUseXFB)
Renderer::DecodeFromXFB(_pXFB, _dwWidth, _dwHeight, _dwYOffset);
// TODO: Use real XFB source parameters based on VI settings
Renderer::Swap();