diff options
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/CVideoModeList.h')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CVideoModeList.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CVideoModeList.h b/libraries/irrlicht-1.8/source/Irrlicht/CVideoModeList.h new file mode 100644 index 0000000..306e11a --- /dev/null +++ b/libraries/irrlicht-1.8/source/Irrlicht/CVideoModeList.h | |||
@@ -0,0 +1,79 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | ||
2 | // This file is part of the "Irrlicht Engine". | ||
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | ||
4 | |||
5 | #ifndef __IRR_C_VIDEO_MODE_LIST_H_INCLUDED__ | ||
6 | #define __IRR_C_VIDEO_MODE_LIST_H_INCLUDED__ | ||
7 | |||
8 | #include "IVideoModeList.h" | ||
9 | #include "dimension2d.h" | ||
10 | #include "irrArray.h" | ||
11 | |||
12 | namespace irr | ||
13 | { | ||
14 | namespace video | ||
15 | { | ||
16 | |||
17 | class CVideoModeList : public IVideoModeList | ||
18 | { | ||
19 | public: | ||
20 | |||
21 | //! constructor | ||
22 | CVideoModeList(); | ||
23 | |||
24 | //! Gets amount of video modes in the list. | ||
25 | virtual s32 getVideoModeCount() const; | ||
26 | |||
27 | //! Returns the screen size of a video mode in pixels. | ||
28 | virtual core::dimension2d<u32> getVideoModeResolution(s32 modeNumber) const; | ||
29 | |||
30 | //! Returns the screen size of an optimal video mode in pixels. | ||
31 | virtual core::dimension2d<u32> getVideoModeResolution(const core::dimension2d<u32>& minSize, const core::dimension2d<u32>& maxSize) const; | ||
32 | |||
33 | //! Returns the pixel depth of a video mode in bits. | ||
34 | virtual s32 getVideoModeDepth(s32 modeNumber) const; | ||
35 | |||
36 | //! Returns current desktop screen resolution. | ||
37 | virtual const core::dimension2d<u32>& getDesktopResolution() const; | ||
38 | |||
39 | //! Returns the pixel depth of a video mode in bits. | ||
40 | virtual s32 getDesktopDepth() const; | ||
41 | |||
42 | //! adds a new mode to the list | ||
43 | void addMode(const core::dimension2d<u32>& size, s32 depth); | ||
44 | |||
45 | void setDesktop(s32 desktopDepth, const core::dimension2d<u32>& desktopSize); | ||
46 | |||
47 | private: | ||
48 | |||
49 | struct SVideoMode | ||
50 | { | ||
51 | core::dimension2d<u32> size; | ||
52 | s32 depth; | ||
53 | |||
54 | bool operator==(const SVideoMode& other) const | ||
55 | { | ||
56 | return size == other.size && depth == other.depth; | ||
57 | } | ||
58 | |||
59 | bool operator <(const SVideoMode& other) const | ||
60 | { | ||
61 | return (size.Width < other.size.Width || | ||
62 | (size.Width == other.size.Width && | ||
63 | size.Height < other.size.Height) || | ||
64 | (size.Width == other.size.Width && | ||
65 | size.Height == other.size.Height && | ||
66 | depth < other.depth)); | ||
67 | } | ||
68 | }; | ||
69 | |||
70 | core::array<SVideoMode> VideoModes; | ||
71 | SVideoMode Desktop; | ||
72 | }; | ||
73 | |||
74 | } // end namespace video | ||
75 | } // end namespace irr | ||
76 | |||
77 | |||
78 | #endif | ||
79 | |||