GDIRenderer - fix bugs in using any font but the old default gdi font (i.e. System) while rendering to offscreen bitmaps (e.g. tastudio)

This commit is contained in:
zeromus 2016-04-16 17:13:36 -05:00
parent 2fafd85064
commit 1bde0c5a72
1 changed files with 4 additions and 3 deletions

View File

@ -45,7 +45,8 @@ namespace BizHawk.Client.EmuHawk.CustomControls
public GDIRenderer()
{
SetBkMode(_hdc, BkModes.OPAQUE);
//zero 04-16-2016 : this can't be legal, theres no HDC yet
//SetBkMode(_hdc, BkModes.OPAQUE);
}
public void Dispose()
@ -168,7 +169,7 @@ namespace BizHawk.Client.EmuHawk.CustomControls
public void PrepDrawString(IntPtr hfont, Color color)
{
SetGraphicsMode(CurrentHDC, 2); //shouldnt be necessary.. cant hurt
SelectObject(_hdc, hfont);
SelectObject(CurrentHDC, hfont);
SetTextColor(color);
}
@ -299,7 +300,7 @@ namespace BizHawk.Client.EmuHawk.CustomControls
/// </summary>
private void SetFont(Font font)
{
SelectObject(_hdc, GetCachedHFont(font));
SelectObject(CurrentHDC, GetCachedHFont(font));
}
private IntPtr GetCachedHFont(Font font)