mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[client] all: properly support guest rotation
If the guest has it's output rotated (ie, landscape) we must rotate and translate the pointer draw location, as well as all the translations of cursor coordinate spaces based on the rotation, along with any local rotations that may also be applied.
This commit is contained in:
@@ -204,7 +204,6 @@ bool egl_desktop_setup(EGL_Desktop * desktop, const LG_RendererFormat format, bo
|
||||
|
||||
desktop->width = format.width;
|
||||
desktop->height = format.height;
|
||||
desktop->rotate = format.rotate;
|
||||
|
||||
if (!egl_texture_setup(
|
||||
desktop->texture,
|
||||
@@ -246,7 +245,9 @@ bool egl_desktop_update(EGL_Desktop * desktop, const FrameBuffer * frame, int dm
|
||||
return true;
|
||||
}
|
||||
|
||||
bool egl_desktop_render(EGL_Desktop * desktop, const float x, const float y, const float scaleX, const float scaleY, const bool nearest)
|
||||
bool egl_desktop_render(EGL_Desktop * desktop, const float x, const float y,
|
||||
const float scaleX, const float scaleY, const bool nearest,
|
||||
LG_RendererRotate rotate)
|
||||
{
|
||||
if (!desktop->shader)
|
||||
return false;
|
||||
@@ -254,7 +255,7 @@ bool egl_desktop_render(EGL_Desktop * desktop, const float x, const float y, con
|
||||
const struct DesktopShader * shader = desktop->shader;
|
||||
egl_shader_use(shader->shader);
|
||||
glUniform4f(shader->uDesktopPos , x, y, scaleX, scaleY);
|
||||
glUniform1i(shader->uRotate , desktop->rotate);
|
||||
glUniform1i(shader->uRotate , rotate);
|
||||
glUniform1i(shader->uNearest , nearest ? 1 : 0);
|
||||
glUniform2f(shader->uDesktopSize, desktop->width, desktop->height);
|
||||
|
||||
|
Reference in New Issue
Block a user