Rename Display to Window.
It makes more sense to be consistent and always call it window.
This commit is contained in:
parent
416a71f744
commit
24da7f45e0
33 changed files with 257 additions and 255 deletions
|
|
@ -1,63 +0,0 @@
|
|||
|
||||
#include <Spectre/Display/DisplayMode.h>
|
||||
#include <Platform/PlatformMisc.h>
|
||||
#include <algorithm>
|
||||
|
||||
namespace sp {
|
||||
|
||||
struct DisplayModeCmp
|
||||
{
|
||||
inline bool operator() (const DisplayMode& a, const DisplayMode& b)
|
||||
{
|
||||
if (a.bpp == b.bpp) {
|
||||
if (a.width == b.width) {
|
||||
return a.height > b.height;
|
||||
}
|
||||
return a.width > b.width;
|
||||
}
|
||||
return a.bpp > b.bpp;
|
||||
}
|
||||
};
|
||||
|
||||
DisplayMode::DisplayMode() :
|
||||
width (0),
|
||||
height (0),
|
||||
bpp (0)
|
||||
{
|
||||
}
|
||||
|
||||
DisplayMode::DisplayMode(unsigned int width, unsigned int height, unsigned int bpp) :
|
||||
width (width),
|
||||
height (height),
|
||||
bpp (bpp)
|
||||
{
|
||||
}
|
||||
|
||||
std::vector<DisplayMode> DisplayMode::getFullscreenModes()
|
||||
{
|
||||
static std::vector<DisplayMode> modes;
|
||||
|
||||
if (modes.size() < 1) {
|
||||
|
||||
PlatformMisc::GetDisplayModes(modes);
|
||||
|
||||
// Sort.
|
||||
std::sort(modes.begin(), modes.end(), DisplayModeCmp());
|
||||
|
||||
// remove duplicates
|
||||
modes.erase(std::unique(modes.begin(), modes.end()), modes.end());
|
||||
}
|
||||
return modes;
|
||||
}
|
||||
|
||||
DisplayMode DisplayMode::getDesktopMode()
|
||||
{
|
||||
return PlatformMisc::GetDesktopMode();
|
||||
}
|
||||
|
||||
bool DisplayMode::empty() const
|
||||
{
|
||||
return (width + height + bpp) == 0;
|
||||
}
|
||||
|
||||
} // namespace sp
|
||||
Loading…
Add table
Add a link
Reference in a new issue