fix XFB enabled at boot. Should save some click for homebrew.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1893 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
memberTwo.mb2 2009-01-17 16:16:47 +00:00
parent 9e676263cd
commit 8ff64a12ea
3 changed files with 11 additions and 1 deletions

View File

@ -38,19 +38,26 @@ enum {
#if XFB_USE_SHADERS
static GLuint xfb_decoded_texture;
static int XFBInitStatus = 0;
void XFB_Init()
{
glGenTextures(1, &xfb_decoded_texture);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, xfb_decoded_texture);
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 4, XFB_WIDTH, XFB_BUF_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
XFBInitStatus = 1;
}
void XFB_Shutdown()
{
glDeleteTextures(1, &xfb_decoded_texture);
XFBInitStatus = 0;
}
int XFB_isInit()
{
return XFBInitStatus;
}
void XFB_Write(u8 *xfb_in_ram, const TRectangle& sourceRc, u32 dstWd, u32 dstHt)
{

View File

@ -30,4 +30,6 @@ void XFB_Draw(u8 *xfb_in_ram, u32 width, u32 height, s32 yOffset);
void XFB_Shutdown();
int XFB_isInit();
#endif

View File

@ -364,6 +364,7 @@ void Video_UpdateXFB(u8* _pXFB, u32 _dwWidth, u32 _dwHeight, s32 _dwYOffset)
{
if(g_Config.bUseXFB)
{
if (XFB_isInit())
XFB_Draw(_pXFB, _dwWidth, _dwHeight, _dwYOffset);
}
}