mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Merged default into minor
--HG-- branch : minor
This commit is contained in:
@@ -497,29 +497,17 @@ std::vector<WindowSize> Window::getFullscreenSizes(int displayindex) const
|
||||
{
|
||||
std::vector<WindowSize> sizes;
|
||||
|
||||
SDL_DisplayMode mode = {};
|
||||
std::vector<WindowSize>::const_iterator it;
|
||||
for (int i = 0; i < SDL_GetNumDisplayModes(displayindex); i++)
|
||||
{
|
||||
SDL_DisplayMode mode = {};
|
||||
SDL_GetDisplayMode(displayindex, i, &mode);
|
||||
|
||||
WindowSize w = {mode.w, mode.h};
|
||||
|
||||
// SDL2's display mode list has multiple entries for modes of the same
|
||||
// size with different bits per pixel, so we need to filter those out.
|
||||
bool alreadyhassize = false;
|
||||
for (it = sizes.begin(); it != sizes.end(); ++it)
|
||||
{
|
||||
if (it->width == mode.w && it->height == mode.h)
|
||||
{
|
||||
alreadyhassize = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!alreadyhassize)
|
||||
{
|
||||
WindowSize w = {mode.w, mode.h};
|
||||
if (std::find(sizes.begin(), sizes.end(), w) == sizes.end())
|
||||
sizes.push_back(w);
|
||||
}
|
||||
}
|
||||
|
||||
return sizes;
|
||||
@@ -767,7 +755,7 @@ SDL_MessageBoxFlags Window::convertMessageBoxType(MessageBoxType type) const
|
||||
}
|
||||
}
|
||||
|
||||
bool Window::showMessageBox(MessageBoxType type, const std::string &title, const std::string &message, bool attachtowindow)
|
||||
bool Window::showMessageBox(const std::string &title, const std::string &message, MessageBoxType type, bool attachtowindow)
|
||||
{
|
||||
SDL_MessageBoxFlags flags = convertMessageBoxType(type);
|
||||
SDL_Window *sdlwindow = attachtowindow ? window : nullptr;
|
||||
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
|
||||
const void *getHandle() const;
|
||||
|
||||
bool showMessageBox(MessageBoxType type, const std::string &title, const std::string &message, bool attachtowindow);
|
||||
bool showMessageBox(const std::string &title, const std::string &message, MessageBoxType type, bool attachtowindow);
|
||||
int showMessageBox(const MessageBoxData &data);
|
||||
|
||||
static love::window::Window *createSingleton();
|
||||
|
||||
Reference in New Issue
Block a user