1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: declares wxVideoMode class used by both wxDisplay and wxApp
4 // Author: Vadim Zeitlin
6 // Created: 27.09.2003 (extracted from wx/display.h)
7 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
14 // ----------------------------------------------------------------------------
15 // wxVideoMode: a simple struct containing video mode parameters for a display
16 // ----------------------------------------------------------------------------
18 struct WXDLLIMPEXP_CORE wxVideoMode
20 wxVideoMode(int width
= 0, int height
= 0, int depth
= 0, int freq
= 0)
30 // default copy ctor and assignment operator are ok
32 bool operator==(const wxVideoMode
& m
) const
34 return w
== m
.w
&& h
== m
.h
&& bpp
== m
.bpp
&& refresh
== m
.refresh
;
36 bool operator!=(const wxVideoMode
& mode
) const
38 return !operator==(mode
);
41 // returns true if this mode matches the other one in the sense that all
42 // non zero fields of the other mode have the same value in this one
43 // (except for refresh which is allowed to have a greater value)
44 bool Matches(const wxVideoMode
& other
) const
46 return (!other
.w
|| w
== other
.w
) &&
47 (!other
.h
|| h
== other
.h
) &&
48 (!other
.bpp
|| bpp
== other
.bpp
) &&
49 (!other
.refresh
|| refresh
>= other
.refresh
);
53 int GetWidth() const { return w
; }
54 int GetHeight() const { return h
; }
55 int GetDepth() const { return bpp
; }
56 int GetRefresh() const { return refresh
; }
58 // returns true if the object has been initialized
59 bool IsOk() const { return w
&& h
; }
62 // the screen size in pixels (e.g. 640*480), 0 means unspecified
65 // bits per pixel (e.g. 32), 1 is monochrome and 0 means unspecified/known
68 // refresh frequency in Hz, 0 means unspecified/unknown
72 #endif // _WX_VMODE_H_