#ifndef __IRR_C_VIDEO_MODE_LIST_H_INCLUDED__
#define __IRR_C_VIDEO_MODE_LIST_H_INCLUDED__
#include "IVideoModeList.h"
#include "dimension2d.h"
#include "irrArray.h"
namespace irr
{
namespace video
{
class CVideoModeList : public IVideoModeList
{
public:
CVideoModeList();
virtual s32 getVideoModeCount() const;
virtual core::dimension2d<u32> getVideoModeResolution(s32 modeNumber) const;
virtual core::dimension2d<u32> getVideoModeResolution(const core::dimension2d<u32>& minSize, const core::dimension2d<u32>& maxSize) const;
virtual s32 getVideoModeDepth(s32 modeNumber) const;
virtual const core::dimension2d<u32>& getDesktopResolution() const;
virtual s32 getDesktopDepth() const;
void addMode(const core::dimension2d<u32>& size, s32 depth);
void setDesktop(s32 desktopDepth, const core::dimension2d<u32>& desktopSize);
private:
struct SVideoMode
{
core::dimension2d<u32> size;
s32 depth;
bool operator==(const SVideoMode& other) const
{
return size == other.size && depth == other.depth;
}
bool operator <(const SVideoMode& other) const
{
return (size.Width < other.size.Width ||
(size.Width == other.size.Width &&
size.Height < other.size.Height) ||
(size.Width == other.size.Width &&
size.Height == other.size.Height &&
depth < other.depth));
}
};
core::array<SVideoMode> VideoModes;
SVideoMode Desktop;
};
}
}
#endif