mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-10 17:38:10 +00:00
[client] all: add screen rotation support win:rotate
Currently only supports EGL, if there is enough demand for OpenGL support this can be added later. Closes #231
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
in highp vec2 uv;
|
||||
out highp vec4 color;
|
||||
uniform int rotate;
|
||||
|
||||
uniform sampler2D sampler1;
|
||||
|
||||
@@ -9,7 +10,28 @@ uniform int cbMode;
|
||||
|
||||
void main()
|
||||
{
|
||||
color = texture(sampler1, uv);
|
||||
highp vec2 ruv;
|
||||
if (rotate == 0) // up
|
||||
{
|
||||
ruv = uv;
|
||||
}
|
||||
else if (rotate == 1) // down
|
||||
{
|
||||
ruv.x = -uv.x + 1.0f;
|
||||
ruv.y = -uv.y + 1.0f;
|
||||
}
|
||||
else if (rotate == 2) // left
|
||||
{
|
||||
ruv.x = -uv.y + 1.0f;
|
||||
ruv.y = uv.x;
|
||||
}
|
||||
else if (rotate == 3) // right
|
||||
{
|
||||
ruv.x = uv.y;
|
||||
ruv.y = -uv.x + 1.0f;
|
||||
}
|
||||
|
||||
color = texture(sampler1, ruv);
|
||||
|
||||
if (cbMode > 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user