Fixed saving states in OGL Linux.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1313 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2008-11-27 12:13:15 +00:00
parent 7a72ed3e4a
commit 3b67df1b45
4 changed files with 37 additions and 24 deletions

View File

@ -93,7 +93,8 @@ void BPWritten(int addr, int changes, int newval)
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
glFrontFace(bpmem.genMode.cullmode == 2 ? GL_CCW : GL_CW); glFrontFace(bpmem.genMode.cullmode == 2 ? GL_CCW : GL_CW);
} }
else glDisable(GL_CULL_FACE); else if(glIsEnabled(GL_CULL_FACE) == GL_TRUE)
glDisable(GL_CULL_FACE);
PixelShaderMngr::SetGenModeChanged(); PixelShaderMngr::SetGenModeChanged();
} }

View File

@ -108,6 +108,8 @@ void TextureMngr::TCacheEntry::SetTextureParameters(TexMode0 &newmode)
void TextureMngr::TCacheEntry::Destroy() void TextureMngr::TCacheEntry::Destroy()
{ {
if(!texture)
return;
glDeleteTextures(1, &texture); glDeleteTextures(1, &texture);
if (!isRenderTarget) { if (!isRenderTarget) {
if (!g_Config.bSafeTextureCache) { if (!g_Config.bSafeTextureCache) {

View File

@ -228,6 +228,16 @@ void Video_Initialize(SVideoInitialize* _pVideoInitialize)
} }
void Video_DoState(unsigned char **ptr, int mode) { void Video_DoState(unsigned char **ptr, int mode) {
#ifdef _WIN32
if (!wglMakeCurrent(hDC,hRC)) {
PanicAlert("Can't Activate The GL Rendering Context for saving");
return false;
}
#elif defined(OSX64)
cocoaGLMakeCurrent(GLWin.cocoaCtx,GLWin.cocoaWin);
#else // Linux
glXMakeCurrent(GLWin.dpy, GLWin.win, GLWin.ctx);
#endif
// Clear all caches that touch RAM // Clear all caches that touch RAM
TextureMngr::Invalidate(); TextureMngr::Invalidate();