Implement wxColourDisplay() in terms of wxDisplay::GetDepth()

Get rid of another global display-related function, even though this one
only had non-trivial implementation under MSW.
This commit is contained in:
Vadim Zeitlin
2018-10-06 16:14:45 +02:00
parent 382404f0a7
commit e3e883bbd2
10 changed files with 11 additions and 62 deletions

View File

@@ -117,27 +117,6 @@ void wxGetMousePosition( int* x, int* y )
if ( y ) *y = pt.y;
}
// Return true if we have a colour display
bool wxColourDisplay()
{
// this function is called from wxDC ctor so it is called a *lot* of times
// hence we optimize it a bit but doing the check only once
//
// this should be MT safe as only the GUI thread (holding the GUI mutex)
// can call us
static int s_isColour = -1;
if ( s_isColour == -1 )
{
ScreenHDC dc;
int noCols = ::GetDeviceCaps(dc, NUMCOLORS);
s_isColour = (noCols == -1) || (noCols > 2);
}
return s_isColour != 0;
}
void wxDisplaySizeMM(int *width, int *height)
{
ScreenHDC dc;