Permalink
Browse files

Renderer: Pull dimensions from GLInterface/Swapchain

  • Loading branch information...
stenzek committed Oct 3, 2018
1 parent a396175 commit 1d827a52234974f308e71e86cdd6f61293e0523f
@@ -209,9 +209,6 @@ class PlatformX11 : public Platform
void MainLoop() override
{
bool fullscreen = SConfig::GetInstance().bFullscreen;
int last_window_width = SConfig::GetInstance().iRenderWindowWidth;
int last_window_height = SConfig::GetInstance().iRenderWindowHeight;
if (fullscreen)
{
rendererIsFullscreen = X11Utils::ToggleFullscreen(dpy, win);
@@ -311,14 +308,8 @@ class PlatformX11 : public Platform
break;
case ConfigureNotify:
{
if (last_window_width != event.xconfigure.width ||
last_window_height != event.xconfigure.height)
{
last_window_width = event.xconfigure.width;
last_window_height = event.xconfigure.height;
if (g_renderer)
g_renderer->ResizeSurface(last_window_width, last_window_height);
}
if (g_renderer)
g_renderer->ResizeSurface();
}
break;
}
@@ -68,7 +68,7 @@ void Host::SetRenderFullscreen(bool fullscreen)
void Host::ResizeSurface(int new_width, int new_height)
{
if (g_renderer)
g_renderer->ResizeSurface(new_width, new_height);
g_renderer->ResizeSurface();
}
void Host_Message(HostMessageID id)
@@ -719,9 +719,6 @@ void Renderer::CheckForSurfaceResize()
if (!m_surface_resized.TestAndClear() && !exclusive_fullscreen_changed)
return;
m_backbuffer_width = m_new_backbuffer_width;
m_backbuffer_height = m_new_backbuffer_height;
SAFE_RELEASE(m_screenshot_texture);
SAFE_RELEASE(m_3d_vision_texture);
m_last_fullscreen_state = fullscreen_state;
@@ -1518,8 +1518,8 @@ void Renderer::CheckForSurfaceResize()
return;
g_main_gl_context->Update();
m_backbuffer_width = m_new_backbuffer_width;
m_backbuffer_height = m_new_backbuffer_height;
m_backbuffer_width = g_main_gl_context->GetBackBufferWidth();
m_backbuffer_height = g_main_gl_context->GetBackBufferHeight();
}
void Renderer::DrawEFB(GLuint framebuffer, const TargetRectangle& target_rc,
@@ -889,9 +889,6 @@ void Renderer::CheckForSurfaceResize()
if (!m_surface_resized.TestAndClear())
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?
// CheckForSurfaceChange should handle this case.
if (!m_swap_chain)
@@ -417,11 +417,9 @@ void Renderer::ChangeSurface(void* new_surface_handle)
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);
m_new_backbuffer_width = new_width;
m_new_backbuffer_height = new_height;
m_surface_resized.Set();
}
@@ -183,7 +183,7 @@ class Renderer
// Final surface changing
// This is called when the surface is resized (WX) or the window changes (Android).
void ChangeSurface(void* new_surface_handle);
void ResizeSurface(int new_width, int new_height);
void ResizeSurface();
bool UseVertexDepthRange() const;
virtual std::unique_ptr<VideoCommon::AsyncShaderCompiler> CreateAsyncShaderCompiler();
@@ -229,8 +229,6 @@ class Renderer
// Backbuffer (window) size and render area
int m_backbuffer_width = 0;
int m_backbuffer_height = 0;
int m_new_backbuffer_width = 0;
int m_new_backbuffer_height = 0;
TargetRectangle m_target_rectangle = {};
FPSCounter m_fps_counter;

0 comments on commit 1d827a5

Please sign in to comment.