// Copyright (C) 2015 Jérôme Leclercq // This file is part of the "Nazara Engine - Utility module" // For conditions of distribution and use, see copyright notice in Config.hpp #include #include #include #include #include namespace Nz { VideoMode VideoModeImpl::GetDesktopMode() { DEVMODE mode; mode.dmSize = sizeof(DEVMODE); EnumDisplaySettings(nullptr, ENUM_CURRENT_SETTINGS, &mode); return VideoMode(mode.dmPelsWidth, mode.dmPelsHeight, static_cast(mode.dmBitsPerPel)); } void VideoModeImpl::GetFullscreenModes(std::vector& modes) { DEVMODE win32Mode; win32Mode.dmSize = sizeof(DEVMODE); for (unsigned int i = 0; EnumDisplaySettings(nullptr, i, &win32Mode); ++i) { VideoMode mode(win32Mode.dmPelsWidth, win32Mode.dmPelsHeight, static_cast(win32Mode.dmBitsPerPel)); // Il existe plusieurs modes avec ces trois caractéristques identiques if (std::find(modes.begin(), modes.end(), mode) == modes.end()) modes.push_back(mode); } } }