mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-25 15:19:53 -06:00
libui: add API for setting a background color for uiArea. (TODO: do for GTK)
make window background black.
This commit is contained in:
@ -40,14 +40,24 @@ static HRESULT doPaint(uiArea *a, ID2D1RenderTarget *rt, RECT *clip)
|
||||
|
||||
// TODO only clear the clip area
|
||||
// TODO clear with actual background brush
|
||||
bgcolorref = GetSysColor(COLOR_BTNFACE);
|
||||
bgcolor.r = ((float) GetRValue(bgcolorref)) / 255.0;
|
||||
// due to utter apathy on Microsoft's part, GetGValue() does not work with MSVC's Run-Time Error Checks
|
||||
// it has not worked since 2008 and they have *never* fixed it
|
||||
// TODO now that -RTCc has just been deprecated entirely, should we switch back?
|
||||
bgcolor.g = ((float) ((BYTE) ((bgcolorref & 0xFF00) >> 8))) / 255.0;
|
||||
bgcolor.b = ((float) GetBValue(bgcolorref)) / 255.0;
|
||||
bgcolor.a = 1.0;
|
||||
if (a->bgR != -1)
|
||||
{
|
||||
bgcolor.r = ((float) a->bgR) / 255.0;
|
||||
bgcolor.g = ((float) a->bgG) / 255.0;
|
||||
bgcolor.b = ((float) a->bgB) / 255.0;
|
||||
bgcolor.a = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
bgcolorref = GetSysColor(COLOR_BTNFACE);
|
||||
bgcolor.r = ((float) GetRValue(bgcolorref)) / 255.0;
|
||||
// due to utter apathy on Microsoft's part, GetGValue() does not work with MSVC's Run-Time Error Checks
|
||||
// it has not worked since 2008 and they have *never* fixed it
|
||||
// TODO now that -RTCc has just been deprecated entirely, should we switch back?
|
||||
bgcolor.g = ((float) ((BYTE) ((bgcolorref & 0xFF00) >> 8))) / 255.0;
|
||||
bgcolor.b = ((float) GetBValue(bgcolorref)) / 255.0;
|
||||
bgcolor.a = 1.0;
|
||||
}
|
||||
rt->Clear(&bgcolor);
|
||||
|
||||
(*(ah->Draw))(ah, a, &dp);
|
||||
|
Reference in New Issue
Block a user