mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-10 09:28:08 +00:00
[client] egl: keep the mouse cursor 1:1 when downscaling
This keeps the cursor a usable size when the guest is running a high resolution and downscaling (ie, 4K -> FHD).
This commit is contained in:
@@ -3,16 +3,26 @@ precision mediump float;
|
||||
|
||||
#include "color_blind.h"
|
||||
|
||||
in vec2 uv;
|
||||
out vec4 color;
|
||||
in vec2 uv;
|
||||
out vec4 color;
|
||||
|
||||
uniform sampler2D sampler1;
|
||||
|
||||
uniform int cbMode;
|
||||
uniform float scale;
|
||||
uniform int cbMode;
|
||||
|
||||
void main()
|
||||
{
|
||||
color = texture(sampler1, uv);
|
||||
if (scale > 1.0)
|
||||
{
|
||||
vec2 ts = vec2(textureSize(sampler1, 0));
|
||||
vec2 px = (uv - (0.5 / ts)) * ts;
|
||||
if (px.x < 0.0 || px.y < 0.0)
|
||||
discard;
|
||||
|
||||
color = texelFetch(sampler1, ivec2(px), 0);
|
||||
}
|
||||
else
|
||||
color = texture(sampler1, uv);
|
||||
|
||||
if (cbMode > 0)
|
||||
color = cbTransform(color, cbMode);
|
||||
|
Reference in New Issue
Block a user