2003-09-27 08:55:46 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/vidmode.h
|
|
|
|
// Purpose: declares wxVideoMode class used by both wxDisplay and wxApp
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 27.09.2003 (extracted from wx/display.h)
|
|
|
|
// RCS-ID: $Id$
|
2004-05-23 10:56:36 -04:00
|
|
|
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2003-09-27 08:55:46 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_VMODE_H_
|
|
|
|
#define _WX_VMODE_H_
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2008-04-11 05:52:04 -04:00
|
|
|
// wxVideoMode: a simple struct containing video mode parameters for a display
|
2003-09-27 08:55:46 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-04-11 05:52:04 -04:00
|
|
|
struct WXDLLIMPEXP_CORE wxVideoMode
|
2003-09-27 08:55:46 -04:00
|
|
|
{
|
|
|
|
wxVideoMode(int width = 0, int height = 0, int depth = 0, int freq = 0)
|
|
|
|
{
|
|
|
|
w = width;
|
|
|
|
h = height;
|
|
|
|
|
|
|
|
bpp = depth;
|
|
|
|
|
|
|
|
refresh = freq;
|
|
|
|
}
|
|
|
|
|
|
|
|
// default copy ctor and assignment operator are ok
|
|
|
|
|
|
|
|
bool operator==(const wxVideoMode& m) const
|
|
|
|
{
|
|
|
|
return w == m.w && h == m.h && bpp == m.bpp && refresh == m.refresh;
|
|
|
|
}
|
|
|
|
bool operator!=(const wxVideoMode& mode) const
|
|
|
|
{
|
|
|
|
return !operator==(mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
// returns true if this mode matches the other one in the sense that all
|
|
|
|
// non zero fields of the other mode have the same value in this one
|
|
|
|
// (except for refresh which is allowed to have a greater value)
|
|
|
|
bool Matches(const wxVideoMode& other) const
|
|
|
|
{
|
|
|
|
return (!other.w || w == other.w) &&
|
|
|
|
(!other.h || h == other.h) &&
|
|
|
|
(!other.bpp || bpp == other.bpp) &&
|
|
|
|
(!other.refresh || refresh >= other.refresh);
|
|
|
|
}
|
|
|
|
|
|
|
|
// trivial accessors
|
|
|
|
int GetWidth() const { return w; }
|
|
|
|
int GetHeight() const { return h; }
|
|
|
|
int GetDepth() const { return bpp; }
|
2008-04-06 16:31:25 -04:00
|
|
|
int GetRefresh() const { return refresh; }
|
2003-09-27 08:55:46 -04:00
|
|
|
|
|
|
|
// returns true if the object has been initialized
|
|
|
|
bool IsOk() const { return w && h; }
|
|
|
|
|
|
|
|
|
|
|
|
// the screen size in pixels (e.g. 640*480), 0 means unspecified
|
|
|
|
int w, h;
|
|
|
|
|
|
|
|
// bits per pixel (e.g. 32), 1 is monochrome and 0 means unspecified/known
|
|
|
|
int bpp;
|
|
|
|
|
|
|
|
// refresh frequency in Hz, 0 means unspecified/unknown
|
|
|
|
int refresh;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_VMODE_H_
|
|
|
|
|