mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -06:00
Renderer: Pull dimensions from GLInterface/Swapchain
This commit is contained in:
@ -209,9 +209,6 @@ class PlatformX11 : public Platform
|
|||||||
void MainLoop() override
|
void MainLoop() override
|
||||||
{
|
{
|
||||||
bool fullscreen = SConfig::GetInstance().bFullscreen;
|
bool fullscreen = SConfig::GetInstance().bFullscreen;
|
||||||
int last_window_width = SConfig::GetInstance().iRenderWindowWidth;
|
|
||||||
int last_window_height = SConfig::GetInstance().iRenderWindowHeight;
|
|
||||||
|
|
||||||
if (fullscreen)
|
if (fullscreen)
|
||||||
{
|
{
|
||||||
rendererIsFullscreen = X11Utils::ToggleFullscreen(dpy, win);
|
rendererIsFullscreen = X11Utils::ToggleFullscreen(dpy, win);
|
||||||
@ -311,14 +308,8 @@ class PlatformX11 : public Platform
|
|||||||
break;
|
break;
|
||||||
case ConfigureNotify:
|
case ConfigureNotify:
|
||||||
{
|
{
|
||||||
if (last_window_width != event.xconfigure.width ||
|
if (g_renderer)
|
||||||
last_window_height != event.xconfigure.height)
|
g_renderer->ResizeSurface();
|
||||||
{
|
|
||||||
last_window_width = event.xconfigure.width;
|
|
||||||
last_window_height = event.xconfigure.height;
|
|
||||||
if (g_renderer)
|
|
||||||
g_renderer->ResizeSurface(last_window_width, last_window_height);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ void Host::SetRenderFullscreen(bool fullscreen)
|
|||||||
void Host::ResizeSurface(int new_width, int new_height)
|
void Host::ResizeSurface(int new_width, int new_height)
|
||||||
{
|
{
|
||||||
if (g_renderer)
|
if (g_renderer)
|
||||||
g_renderer->ResizeSurface(new_width, new_height);
|
g_renderer->ResizeSurface();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Host_Message(HostMessageID id)
|
void Host_Message(HostMessageID id)
|
||||||
|
@ -719,9 +719,6 @@ void Renderer::CheckForSurfaceResize()
|
|||||||
if (!m_surface_resized.TestAndClear() && !exclusive_fullscreen_changed)
|
if (!m_surface_resized.TestAndClear() && !exclusive_fullscreen_changed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_backbuffer_width = m_new_backbuffer_width;
|
|
||||||
m_backbuffer_height = m_new_backbuffer_height;
|
|
||||||
|
|
||||||
SAFE_RELEASE(m_screenshot_texture);
|
SAFE_RELEASE(m_screenshot_texture);
|
||||||
SAFE_RELEASE(m_3d_vision_texture);
|
SAFE_RELEASE(m_3d_vision_texture);
|
||||||
m_last_fullscreen_state = fullscreen_state;
|
m_last_fullscreen_state = fullscreen_state;
|
||||||
|
@ -1518,8 +1518,8 @@ void Renderer::CheckForSurfaceResize()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
g_main_gl_context->Update();
|
g_main_gl_context->Update();
|
||||||
m_backbuffer_width = m_new_backbuffer_width;
|
m_backbuffer_width = g_main_gl_context->GetBackBufferWidth();
|
||||||
m_backbuffer_height = m_new_backbuffer_height;
|
m_backbuffer_height = g_main_gl_context->GetBackBufferHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::DrawEFB(GLuint framebuffer, const TargetRectangle& target_rc,
|
void Renderer::DrawEFB(GLuint framebuffer, const TargetRectangle& target_rc,
|
||||||
|
@ -889,9 +889,6 @@ void Renderer::CheckForSurfaceResize()
|
|||||||
if (!m_surface_resized.TestAndClear())
|
if (!m_surface_resized.TestAndClear())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_backbuffer_width = m_new_backbuffer_width;
|
|
||||||
m_backbuffer_height = m_new_backbuffer_height;
|
|
||||||
|
|
||||||
// If we don't have a surface, how can we resize the swap chain?
|
// If we don't have a surface, how can we resize the swap chain?
|
||||||
// CheckForSurfaceChange should handle this case.
|
// CheckForSurfaceChange should handle this case.
|
||||||
if (!m_swap_chain)
|
if (!m_swap_chain)
|
||||||
|
@ -417,11 +417,9 @@ void Renderer::ChangeSurface(void* new_surface_handle)
|
|||||||
m_surface_changed.Set();
|
m_surface_changed.Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::ResizeSurface(int new_width, int new_height)
|
void Renderer::ResizeSurface()
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(m_swap_mutex);
|
std::lock_guard<std::mutex> lock(m_swap_mutex);
|
||||||
m_new_backbuffer_width = new_width;
|
|
||||||
m_new_backbuffer_height = new_height;
|
|
||||||
m_surface_resized.Set();
|
m_surface_resized.Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ public:
|
|||||||
// Final surface changing
|
// Final surface changing
|
||||||
// This is called when the surface is resized (WX) or the window changes (Android).
|
// This is called when the surface is resized (WX) or the window changes (Android).
|
||||||
void ChangeSurface(void* new_surface_handle);
|
void ChangeSurface(void* new_surface_handle);
|
||||||
void ResizeSurface(int new_width, int new_height);
|
void ResizeSurface();
|
||||||
bool UseVertexDepthRange() const;
|
bool UseVertexDepthRange() const;
|
||||||
|
|
||||||
virtual std::unique_ptr<VideoCommon::AsyncShaderCompiler> CreateAsyncShaderCompiler();
|
virtual std::unique_ptr<VideoCommon::AsyncShaderCompiler> CreateAsyncShaderCompiler();
|
||||||
@ -229,8 +229,6 @@ protected:
|
|||||||
// Backbuffer (window) size and render area
|
// Backbuffer (window) size and render area
|
||||||
int m_backbuffer_width = 0;
|
int m_backbuffer_width = 0;
|
||||||
int m_backbuffer_height = 0;
|
int m_backbuffer_height = 0;
|
||||||
int m_new_backbuffer_width = 0;
|
|
||||||
int m_new_backbuffer_height = 0;
|
|
||||||
TargetRectangle m_target_rectangle = {};
|
TargetRectangle m_target_rectangle = {};
|
||||||
|
|
||||||
FPSCounter m_fps_counter;
|
FPSCounter m_fps_counter;
|
||||||
|
Reference in New Issue
Block a user