Add fullscreen desktop option for non-ge capable device
This commit is contained in:
parent
d9fad6ab55
commit
4c7353a3a4
@ -24,7 +24,7 @@ struct GEConfig
|
|||||||
bool m_disable_npot_texture;
|
bool m_disable_npot_texture;
|
||||||
bool m_convert_irrlicht_mesh;
|
bool m_convert_irrlicht_mesh;
|
||||||
bool m_texture_compression;
|
bool m_texture_compression;
|
||||||
bool m_vulkan_fullscreen_desktop;
|
bool m_fullscreen_desktop;
|
||||||
bool m_enable_draw_call_cache;
|
bool m_enable_draw_call_cache;
|
||||||
std::unordered_set<std::string> m_ondemand_load_texture_paths;
|
std::unordered_set<std::string> m_ondemand_load_texture_paths;
|
||||||
float m_render_scale;
|
float m_render_scale;
|
||||||
|
@ -94,9 +94,9 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
|||||||
// Prevent fullscreen minimizes when losing focus
|
// Prevent fullscreen minimizes when losing focus
|
||||||
if (CreationParams.Fullscreen)
|
if (CreationParams.Fullscreen)
|
||||||
{
|
{
|
||||||
if (CreationParams.DriverType != video::EDT_VULKAN)
|
if (!GE::getGEConfig()->m_fullscreen_desktop)
|
||||||
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
|
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
|
||||||
else if (!GE::getGEConfig()->m_vulkan_fullscreen_desktop)
|
else if (CreationParams.DriverType != video::EDT_VULKAN)
|
||||||
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
|
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -356,7 +356,7 @@ bool versionCorrect(int major, int minor)
|
|||||||
extern "C" void update_fullscreen_desktop(int val)
|
extern "C" void update_fullscreen_desktop(int val)
|
||||||
{
|
{
|
||||||
GE::GEVulkanDriver* gevk = GE::getVKDriver();
|
GE::GEVulkanDriver* gevk = GE::getVKDriver();
|
||||||
if (!gevk || !GE::getGEConfig()->m_vulkan_fullscreen_desktop)
|
if (!gevk || !GE::getGEConfig()->m_fullscreen_desktop)
|
||||||
return;
|
return;
|
||||||
SDL_Window* window = gevk->getSDLWindow();
|
SDL_Window* window = gevk->getSDLWindow();
|
||||||
|
|
||||||
@ -442,8 +442,7 @@ bool CIrrDeviceSDL::createWindow()
|
|||||||
|
|
||||||
if (CreationParams.Fullscreen)
|
if (CreationParams.Fullscreen)
|
||||||
{
|
{
|
||||||
if (CreationParams.DriverType == video::EDT_VULKAN &&
|
if (GE::getGEConfig()->m_fullscreen_desktop)
|
||||||
GE::getGEConfig()->m_vulkan_fullscreen_desktop)
|
|
||||||
{
|
{
|
||||||
flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
|
flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||||
CreationParams.Fullscreen = false;
|
CreationParams.Fullscreen = false;
|
||||||
|
@ -732,6 +732,10 @@ namespace UserConfigParams
|
|||||||
&m_video_group, "Use SDL_WINDOW_FULLSCREEN_DESKTOP for vulkan device"));
|
&m_video_group, "Use SDL_WINDOW_FULLSCREEN_DESKTOP for vulkan device"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
PARAM_PREFIX BoolUserConfigParam m_non_ge_fullscreen_desktop
|
||||||
|
PARAM_DEFAULT(BoolUserConfigParam(false, "non_ge_fullscreen_desktop",
|
||||||
|
&m_video_group, "Use SDL_WINDOW_FULLSCREEN_DESKTOP for non-ge device"));
|
||||||
|
|
||||||
// ---- Recording
|
// ---- Recording
|
||||||
PARAM_PREFIX GroupUserConfigParam m_recording_group
|
PARAM_PREFIX GroupUserConfigParam m_recording_group
|
||||||
PARAM_DEFAULT(GroupUserConfigParam("Recording",
|
PARAM_DEFAULT(GroupUserConfigParam("Recording",
|
||||||
|
@ -510,8 +510,6 @@ begin:
|
|||||||
UserConfigParams::m_texture_compression;
|
UserConfigParams::m_texture_compression;
|
||||||
GE::getGEConfig()->m_render_scale =
|
GE::getGEConfig()->m_render_scale =
|
||||||
UserConfigParams::m_scale_rtts_factor;
|
UserConfigParams::m_scale_rtts_factor;
|
||||||
GE::getGEConfig()->m_vulkan_fullscreen_desktop =
|
|
||||||
UserConfigParams::m_vulkan_fullscreen_desktop;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -526,6 +524,13 @@ begin:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef SERVER_ONLY
|
||||||
|
GE::getGEConfig()->m_fullscreen_desktop =
|
||||||
|
(driver_created == video::EDT_VULKAN &&
|
||||||
|
UserConfigParams::m_vulkan_fullscreen_desktop) ||
|
||||||
|
UserConfigParams::m_non_ge_fullscreen_desktop;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Try 32 and, upon failure, 24 then 16 bit per pixels
|
// Try 32 and, upon failure, 24 then 16 bit per pixels
|
||||||
for (int bits=32; bits>15; bits -=8)
|
for (int bits=32; bits>15; bits -=8)
|
||||||
{
|
{
|
||||||
|
@ -321,11 +321,14 @@ void OptionsScreenVideo::init()
|
|||||||
assert( rememberWinposText != NULL );
|
assert( rememberWinposText != NULL );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool is_fullscreen_desktop = false;
|
||||||
bool is_vulkan_fullscreen_desktop = false;
|
bool is_vulkan_fullscreen_desktop = false;
|
||||||
#ifndef SERVER_ONLY
|
#ifndef SERVER_ONLY
|
||||||
|
is_fullscreen_desktop =
|
||||||
|
GE::getGEConfig()->m_fullscreen_desktop;
|
||||||
is_vulkan_fullscreen_desktop =
|
is_vulkan_fullscreen_desktop =
|
||||||
GE::getDriver()->getDriverType() == video::EDT_VULKAN &&
|
GE::getDriver()->getDriverType() == video::EDT_VULKAN &&
|
||||||
GE::getGEConfig()->m_vulkan_fullscreen_desktop;
|
is_fullscreen_desktop;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// --- get resolution list from irrlicht the first time
|
// --- get resolution list from irrlicht the first time
|
||||||
@ -371,8 +374,8 @@ void OptionsScreenVideo::init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vulkan use fullscreen desktop so only show current screen size
|
// Use fullscreen desktop so only show current screen size
|
||||||
if (is_vulkan_fullscreen_desktop)
|
if (is_fullscreen_desktop)
|
||||||
{
|
{
|
||||||
found_config_res = false;
|
found_config_res = false;
|
||||||
m_resolutions.clear();
|
m_resolutions.clear();
|
||||||
@ -384,7 +387,7 @@ void OptionsScreenVideo::init()
|
|||||||
{
|
{
|
||||||
r.width = UserConfigParams::m_real_width;
|
r.width = UserConfigParams::m_real_width;
|
||||||
r.height = UserConfigParams::m_real_height;
|
r.height = UserConfigParams::m_real_height;
|
||||||
r.fullscreen = is_vulkan_fullscreen_desktop;
|
r.fullscreen = is_fullscreen_desktop;
|
||||||
m_resolutions.push_back(r);
|
m_resolutions.push_back(r);
|
||||||
|
|
||||||
if (r.width == 1024 && r.height == 768)
|
if (r.width == 1024 && r.height == 768)
|
||||||
@ -896,7 +899,7 @@ void OptionsScreenVideo::eventCallback(Widget* widget, const std::string& name,
|
|||||||
rememberWinpos->setActive(!fullscreen->getState());
|
rememberWinpos->setActive(!fullscreen->getState());
|
||||||
#ifndef SERVER_ONLY
|
#ifndef SERVER_ONLY
|
||||||
GE::GEVulkanDriver* gevk = GE::getVKDriver();
|
GE::GEVulkanDriver* gevk = GE::getVKDriver();
|
||||||
if (gevk && GE::getGEConfig()->m_vulkan_fullscreen_desktop)
|
if (gevk && GE::getGEConfig()->m_fullscreen_desktop)
|
||||||
{
|
{
|
||||||
UserConfigParams::m_fullscreen = fullscreen->getState();
|
UserConfigParams::m_fullscreen = fullscreen->getState();
|
||||||
update_fullscreen_desktop(UserConfigParams::m_fullscreen);
|
update_fullscreen_desktop(UserConfigParams::m_fullscreen);
|
||||||
|
Loading…
Reference in New Issue
Block a user