Changed the default fullscreen type from 'exclusive' to 'desktop'.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2015-02-21 17:27:54 -04:00
parent 33f57ce8fd
commit bf8f6f8b02
6 changed files with 25 additions and 25 deletions
+7 -7
View File
@@ -89,19 +89,19 @@ StringMap<Window::Setting, Window::SETTING_MAX_ENUM>::Entry Window::settingEntri
StringMap<Window::Setting, Window::SETTING_MAX_ENUM> Window::settings(Window::settingEntries, sizeof(Window::settingEntries)); StringMap<Window::Setting, Window::SETTING_MAX_ENUM> Window::settings(Window::settingEntries, sizeof(Window::settingEntries));
StringMap<Window::FullscreenType, Window::FULLSCREEN_TYPE_MAX_ENUM>::Entry Window::fullscreenTypeEntries[] = StringMap<Window::FullscreenType, Window::FULLSCREEN_MAX_ENUM>::Entry Window::fullscreenTypeEntries[] =
{ {
{"exclusive", Window::FULLSCREEN_TYPE_EXCLUSIVE}, {"exclusive", FULLSCREEN_EXCLUSIVE},
{"desktop", Window::FULLSCREEN_TYPE_DESKTOP}, {"desktop", FULLSCREEN_DESKTOP},
}; };
StringMap<Window::FullscreenType, Window::FULLSCREEN_TYPE_MAX_ENUM> Window::fullscreenTypes(Window::fullscreenTypeEntries, sizeof(Window::fullscreenTypeEntries)); StringMap<Window::FullscreenType, Window::FULLSCREEN_MAX_ENUM> Window::fullscreenTypes(Window::fullscreenTypeEntries, sizeof(Window::fullscreenTypeEntries));
StringMap<Window::MessageBoxType, Window::MESSAGEBOX_MAX_ENUM>::Entry Window::messageBoxTypeEntries[] = StringMap<Window::MessageBoxType, Window::MESSAGEBOX_MAX_ENUM>::Entry Window::messageBoxTypeEntries[] =
{ {
{"error", Window::MESSAGEBOX_ERROR}, {"error", MESSAGEBOX_ERROR},
{"warning", Window::MESSAGEBOX_WARNING}, {"warning", MESSAGEBOX_WARNING},
{"info", Window::MESSAGEBOX_INFO}, {"info", MESSAGEBOX_INFO},
}; };
StringMap<Window::MessageBoxType, Window::MESSAGEBOX_MAX_ENUM> Window::messageBoxTypes(Window::messageBoxTypeEntries, sizeof(Window::messageBoxTypeEntries)); StringMap<Window::MessageBoxType, Window::MESSAGEBOX_MAX_ENUM> Window::messageBoxTypes(Window::messageBoxTypeEntries, sizeof(Window::messageBoxTypeEntries));
+6 -6
View File
@@ -66,9 +66,9 @@ public:
enum FullscreenType enum FullscreenType
{ {
FULLSCREEN_TYPE_EXCLUSIVE, FULLSCREEN_EXCLUSIVE,
FULLSCREEN_TYPE_DESKTOP, FULLSCREEN_DESKTOP,
FULLSCREEN_TYPE_MAX_ENUM FULLSCREEN_MAX_ENUM
}; };
enum MessageBoxType enum MessageBoxType
@@ -189,8 +189,8 @@ private:
static StringMap<Setting, SETTING_MAX_ENUM>::Entry settingEntries[]; static StringMap<Setting, SETTING_MAX_ENUM>::Entry settingEntries[];
static StringMap<Setting, SETTING_MAX_ENUM> settings; static StringMap<Setting, SETTING_MAX_ENUM> settings;
static StringMap<FullscreenType, FULLSCREEN_TYPE_MAX_ENUM>::Entry fullscreenTypeEntries[]; static StringMap<FullscreenType, FULLSCREEN_MAX_ENUM>::Entry fullscreenTypeEntries[];
static StringMap<FullscreenType, FULLSCREEN_TYPE_MAX_ENUM> fullscreenTypes; static StringMap<FullscreenType, FULLSCREEN_MAX_ENUM> fullscreenTypes;
static StringMap<MessageBoxType, MESSAGEBOX_MAX_ENUM>::Entry messageBoxTypeEntries[]; static StringMap<MessageBoxType, MESSAGEBOX_MAX_ENUM>::Entry messageBoxTypeEntries[];
static StringMap<MessageBoxType, MESSAGEBOX_MAX_ENUM> messageBoxTypes; static StringMap<MessageBoxType, MESSAGEBOX_MAX_ENUM> messageBoxTypes;
@@ -200,7 +200,7 @@ private:
struct WindowSettings struct WindowSettings
{ {
bool fullscreen = false; bool fullscreen = false;
Window::FullscreenType fstype = Window::FULLSCREEN_TYPE_EXCLUSIVE; Window::FullscreenType fstype = Window::FULLSCREEN_DESKTOP;
bool vsync = true; bool vsync = true;
int msaa = 0; int msaa = 0;
bool resizable = false; bool resizable = false;
+5 -5
View File
@@ -376,7 +376,7 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
if (f.fullscreen) if (f.fullscreen)
{ {
if (f.fstype == FULLSCREEN_TYPE_DESKTOP) if (f.fstype == FULLSCREEN_DESKTOP)
sdlflags |= SDL_WINDOW_FULLSCREEN_DESKTOP; sdlflags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
else else
{ {
@@ -511,12 +511,12 @@ void Window::updateSettings(const WindowSettings &newsettings)
if ((wflags & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP) if ((wflags & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP)
{ {
curMode.settings.fullscreen = true; curMode.settings.fullscreen = true;
curMode.settings.fstype = FULLSCREEN_TYPE_DESKTOP; curMode.settings.fstype = FULLSCREEN_DESKTOP;
} }
else if ((wflags & SDL_WINDOW_FULLSCREEN) == SDL_WINDOW_FULLSCREEN) else if ((wflags & SDL_WINDOW_FULLSCREEN) == SDL_WINDOW_FULLSCREEN)
{ {
curMode.settings.fullscreen = true; curMode.settings.fullscreen = true;
curMode.settings.fstype = FULLSCREEN_TYPE_EXCLUSIVE; curMode.settings.fstype = FULLSCREEN_EXCLUSIVE;
} }
else else
{ {
@@ -547,7 +547,7 @@ void Window::updateSettings(const WindowSettings &newsettings)
// Only minimize on focus loss if the window is in exclusive-fullscreen // Only minimize on focus loss if the window is in exclusive-fullscreen
// mode. // mode.
if (curMode.settings.fullscreen && curMode.settings.fstype == FULLSCREEN_TYPE_EXCLUSIVE) if (curMode.settings.fullscreen && curMode.settings.fstype == FULLSCREEN_EXCLUSIVE)
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "1"); SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "1");
else else
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0"); SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
@@ -594,7 +594,7 @@ bool Window::setFullscreen(bool fullscreen, Window::FullscreenType fstype)
if (fullscreen) if (fullscreen)
{ {
if (fstype == FULLSCREEN_TYPE_DESKTOP) if (fstype == FULLSCREEN_DESKTOP)
sdlflags = SDL_WINDOW_FULLSCREEN_DESKTOP; sdlflags = SDL_WINDOW_FULLSCREEN_DESKTOP;
else else
{ {
+5 -5
View File
@@ -92,8 +92,8 @@ int w_setMode(lua_State *L)
} }
else else
{ {
// Default to exclusive fullscreen mode. // Default to desktop fullscreen mode.
settings.fstype = Window::FULLSCREEN_TYPE_EXCLUSIVE; settings.fstype = Window::FULLSCREEN_DESKTOP;
} }
lua_pop(L, 1); lua_pop(L, 1);
@@ -138,7 +138,7 @@ int w_getMode(lua_State *L)
lua_newtable(L); lua_newtable(L);
const char *fstypestr = "exclusive"; const char *fstypestr = "desktop";
Window::getConstant(settings.fstype, fstypestr); Window::getConstant(settings.fstype, fstypestr);
lua_pushstring(L, fstypestr); lua_pushstring(L, fstypestr);
@@ -222,14 +222,14 @@ int w_getFullscreenModes(lua_State *L)
int w_setFullscreen(lua_State *L) int w_setFullscreen(lua_State *L)
{ {
bool fullscreen = luax_toboolean(L, 1); bool fullscreen = luax_toboolean(L, 1);
Window::FullscreenType fstype = Window::FULLSCREEN_TYPE_MAX_ENUM; Window::FullscreenType fstype = Window::FULLSCREEN_MAX_ENUM;
const char *typestr = lua_isnoneornil(L, 2) ? 0 : luaL_checkstring(L, 2); const char *typestr = lua_isnoneornil(L, 2) ? 0 : luaL_checkstring(L, 2);
if (typestr && !Window::getConstant(typestr, fstype)) if (typestr && !Window::getConstant(typestr, fstype))
return luaL_error(L, "Invalid fullscreen type: %s", typestr); return luaL_error(L, "Invalid fullscreen type: %s", typestr);
bool success = false; bool success = false;
if (fstype == Window::FULLSCREEN_TYPE_MAX_ENUM) if (fstype == Window::FULLSCREEN_MAX_ENUM)
success = instance()->setFullscreen(fullscreen); success = instance()->setFullscreen(fullscreen);
else else
success = instance()->setFullscreen(fullscreen, fstype); success = instance()->setFullscreen(fullscreen, fstype);
+1 -1
View File
@@ -326,7 +326,7 @@ function love.init()
minwidth = 1, minwidth = 1,
minheight = 1, minheight = 1,
fullscreen = false, fullscreen = false,
fullscreentype = "exclusive", fullscreentype = "desktop",
display = 1, display = 1,
vsync = true, vsync = true,
msaa = 0, msaa = 0,
+1 -1
View File
@@ -607,7 +607,7 @@ const unsigned char boot_lua[] =
0x09, 0x09, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x09, 0x09, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x3d, 0x20, 0x66, 0x61,
0x6c, 0x73, 0x65, 0x2c, 0x0a, 0x6c, 0x73, 0x65, 0x2c, 0x0a,
0x09, 0x09, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x20, 0x09, 0x09, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x20,
0x3d, 0x20, 0x22, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x22, 0x2c, 0x0a, 0x3d, 0x20, 0x22, 0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x22, 0x2c, 0x0a,
0x09, 0x09, 0x09, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x3d, 0x20, 0x31, 0x2c, 0x0a, 0x09, 0x09, 0x09, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x3d, 0x20, 0x31, 0x2c, 0x0a,
0x09, 0x09, 0x09, 0x76, 0x73, 0x79, 0x6e, 0x63, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x0a, 0x09, 0x09, 0x09, 0x76, 0x73, 0x79, 0x6e, 0x63, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x0a,
0x09, 0x09, 0x09, 0x6d, 0x73, 0x61, 0x61, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x0a, 0x09, 0x09, 0x09, 0x6d, 0x73, 0x61, 0x61, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x0a,