libretro: Use framebuffer view dimensions not texture dimensions

This commit is contained in:
Connor McLaughlin
2020-07-01 00:43:17 +10:00
parent 70f4ce7cde
commit 8cd9e0887e
6 changed files with 24 additions and 14 deletions

View File

@ -461,13 +461,13 @@ void OpenGLHostDisplay::RenderSoftwareCursor()
return;
const auto [left, top, width, height] = CalculateSoftwareCursorDrawRect();
RenderSoftwareCursor(left, top, width, height, m_cursor_texture.get());
RenderSoftwareCursor(left, GetWindowHeight() - top - height, width, height, m_cursor_texture.get());
}
void OpenGLHostDisplay::RenderSoftwareCursor(s32 left, s32 top, s32 width, s32 height,
void OpenGLHostDisplay::RenderSoftwareCursor(s32 left, s32 bottom, s32 width, s32 height,
HostDisplayTexture* texture_handle)
{
glViewport(left, GetWindowHeight() - top - height, width, height);
glViewport(left, bottom, width, height);
glEnable(GL_BLEND);
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO);
glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD);

View File

@ -69,7 +69,7 @@ protected:
void RenderDisplay(s32 left, s32 bottom, s32 width, s32 height, void* texture_handle, u32 texture_width,
s32 texture_height, s32 texture_view_x, s32 texture_view_y, s32 texture_view_width,
s32 texture_view_height, bool linear_filter);
void RenderSoftwareCursor(s32 left, s32 top, s32 width, s32 height, HostDisplayTexture* texture_handle);
void RenderSoftwareCursor(s32 left, s32 bottom, s32 width, s32 height, HostDisplayTexture* texture_handle);
std::unique_ptr<GL::Context> m_gl_context;