fix yabause+gl crashes (loadstate can trigger GL work, context needed setting ahead of time)

This commit is contained in:
zeromus 2014-06-09 03:13:59 +00:00
parent e7a956e18a
commit dbeaede567
1 changed files with 7 additions and 0 deletions

View File

@ -371,7 +371,14 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
{
var fp = new FilePiping();
fp.Offer(data);
//loadstate can trigger GL work
CoreComm.ActivateGLContext(glContext);
bool succeed = LibYabause.libyabause_loadstate(fp.GetPipeNameNative());
CoreComm.DeactivateGLContext();
fp.Finish();
if (!succeed)
throw new Exception("libyabause_loadstate() failed");