mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-17 08:15:45 -04:00
OpenGLHostDisplay: Support fullscreen mode enumeration (DRM only)
This commit is contained in:
@ -2870,6 +2870,11 @@ bool CommonHostInterface::ParseFullscreenMode(const std::string_view& mode, u32*
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string CommonHostInterface::GetFullscreenModeString(u32 width, u32 height, float refresh_rate)
|
||||
{
|
||||
return StringUtil::StdStringFromFormat("%u x %u @ %f hz", width, height, refresh_rate);
|
||||
}
|
||||
|
||||
bool CommonHostInterface::RequestRenderWindowSize(s32 new_window_width, s32 new_window_height)
|
||||
{
|
||||
return false;
|
||||
|
@ -241,6 +241,9 @@ public:
|
||||
/// Parses a fullscreen mode into its components (width * height @ refresh hz)
|
||||
static bool ParseFullscreenMode(const std::string_view& mode, u32* width, u32* height, float* refresh_rate);
|
||||
|
||||
/// Converts a fullscreen mode to a string.
|
||||
static std::string GetFullscreenModeString(u32 width, u32 height, float refresh_rate);
|
||||
|
||||
/// Returns true if fast forwarding or slow motion is currently active.
|
||||
bool IsRunningAtNonStandardSpeed() const;
|
||||
|
||||
|
@ -4,14 +4,15 @@
|
||||
#include "common/d3d11/shader_compiler.h"
|
||||
#include "common/log.h"
|
||||
#include "common/string_util.h"
|
||||
#include "common_host_interface.h"
|
||||
#include "core/host_interface.h"
|
||||
#include "core/settings.h"
|
||||
#include "core/shader_cache_version.h"
|
||||
#include "display_ps.hlsl.h"
|
||||
#include "display_vs.hlsl.h"
|
||||
#include "frontend-common/postprocessing_shadergen.h"
|
||||
#include "imgui.h"
|
||||
#include "imgui_impl_dx11.h"
|
||||
#include "postprocessing_shadergen.h"
|
||||
#include <array>
|
||||
#include <dxgi1_5.h>
|
||||
Log_SetChannel(D3D11HostDisplay);
|
||||
@ -843,8 +844,8 @@ HostDisplay::AdapterAndModeList D3D11HostDisplay::GetAdapterAndModeList(IDXGIFac
|
||||
{
|
||||
for (const DXGI_MODE_DESC& mode : modes)
|
||||
{
|
||||
adapter_info.fullscreen_modes.push_back(StringUtil::StdStringFromFormat(
|
||||
"%u x %u @ %f hz", mode.Width, mode.Height,
|
||||
adapter_info.fullscreen_modes.push_back(CommonHostInterface::GetFullscreenModeString(
|
||||
mode.Width, mode.Height,
|
||||
static_cast<float>(mode.RefreshRate.Numerator) / static_cast<float>(mode.RefreshRate.Denominator)));
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "common/assert.h"
|
||||
#include "common/log.h"
|
||||
#include "common/string_util.h"
|
||||
#include "common_host_interface.h"
|
||||
#include "imgui.h"
|
||||
#include "imgui_impl_opengl3.h"
|
||||
#include "postprocessing_shadergen.h"
|
||||
@ -512,7 +513,18 @@ bool OpenGLHostDisplay::SetFullscreen(bool fullscreen, u32 width, u32 height, fl
|
||||
|
||||
HostDisplay::AdapterAndModeList OpenGLHostDisplay::GetAdapterAndModeList()
|
||||
{
|
||||
return {};
|
||||
AdapterAndModeList aml;
|
||||
|
||||
if (m_gl_context)
|
||||
{
|
||||
for (const GL::Context::FullscreenModeInfo& fmi : m_gl_context->EnumerateFullscreenModes())
|
||||
{
|
||||
aml.fullscreen_modes.push_back(
|
||||
CommonHostInterface::GetFullscreenModeString(fmi.width, fmi.height, fmi.refresh_rate));
|
||||
}
|
||||
}
|
||||
|
||||
return aml;
|
||||
}
|
||||
|
||||
void OpenGLHostDisplay::DestroyRenderSurface()
|
||||
|
Reference in New Issue
Block a user