]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/vidmode.h
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)
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
15 // ----------------------------------------------------------------------------
16 // wxVideoMode: a simple struct containing video mode parameters for a display
17 // ----------------------------------------------------------------------------
19 struct WXDLLEXPORT wxVideoMode
21 wxVideoMode(int width
= 0, int height
= 0, int depth
= 0, int freq
= 0)
31 // default copy ctor and assignment operator are ok
33 bool operator==(const wxVideoMode
& m
) const
35 return w
== m
.w
&& h
== m
.h
&& bpp
== m
.bpp
&& refresh
== m
.refresh
;
37 bool operator!=(const wxVideoMode
& mode
) const
39 return !operator==(mode
);
42 // returns true if this mode matches the other one in the sense that all
43 // non zero fields of the other mode have the same value in this one
44 // (except for refresh which is allowed to have a greater value)
45 bool Matches(const wxVideoMode
& other
) const
47 return (!other
.w
|| w
== other
.w
) &&
48 (!other
.h
|| h
== other
.h
) &&
49 (!other
.bpp
|| bpp
== other
.bpp
) &&
50 (!other
.refresh
|| refresh
>= other
.refresh
);
54 int GetWidth() const { return w
; }
55 int GetHeight() const { return h
; }
56 int GetDepth() const { return bpp
; }
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_