diff --git a/Assets/uDesktopDuplication/Examples/Scenes/Multiple Monitors.unity b/Assets/uDesktopDuplication/Examples/Scenes/Multiple Monitors.unity index 7be8a9b..59c50ed 100644 Binary files a/Assets/uDesktopDuplication/Examples/Scenes/Multiple Monitors.unity and b/Assets/uDesktopDuplication/Examples/Scenes/Multiple Monitors.unity differ diff --git a/Assets/uDesktopDuplication/Plugins/uDesktopDuplication.dll b/Assets/uDesktopDuplication/Plugins/uDesktopDuplication.dll index d8e0265..c111ccd 100644 Binary files a/Assets/uDesktopDuplication/Plugins/uDesktopDuplication.dll and b/Assets/uDesktopDuplication/Plugins/uDesktopDuplication.dll differ diff --git a/Assets/uDesktopDuplication/Scripts/Cursor.cs b/Assets/uDesktopDuplication/Scripts/Cursor.cs index cad4640..d0ff188 100644 --- a/Assets/uDesktopDuplication/Scripts/Cursor.cs +++ b/Assets/uDesktopDuplication/Scripts/Cursor.cs @@ -8,14 +8,13 @@ namespace uDesktopDuplication RequireComponent(typeof(Texture))] public class Cursor : MonoBehaviour { + [SerializeField] Vector2 modelScale = Vector2.one; + Vector3 worldPosition { get; set; } private Texture uddTexture_; private Monitor monitor { get { return uddTexture_.monitor; } } - - private Texture2D currentTexture_; private Dictionary textures_ = new Dictionary(); - [SerializeField] Vector2 modelScale = Vector2.one; void Start() { diff --git a/Assets/uDesktopDuplication/Shaders/uDD_Common.cginc b/Assets/uDesktopDuplication/Shaders/uDD_Common.cginc index 86bde2a..36fcf44 100644 --- a/Assets/uDesktopDuplication/Shaders/uDD_Common.cginc +++ b/Assets/uDesktopDuplication/Shaders/uDD_Common.cginc @@ -74,8 +74,8 @@ inline fixed4 uddGetCursorTexture(float2 uv) uv.x = (uv.x - _CursorX) / _CursorWidth; uv.y = (uv.y - _CursorY) / _CursorHeight; fixed4 c = tex2D(_CursorTex, uv); - fixed a = c.a * step(0, uv.x) * step(0, uv.y) * step(uv.x, 1) * step(uv.y, 1); - c *= step(0.01, a); + fixed a = step(0, uv.x) * step(0, uv.y) * step(uv.x, 1) * step(uv.y, 1); + c.a *= step(0.01, a); return c; } diff --git a/Assets/uDesktopDuplication/Shaders/uDD_Unlit.shader b/Assets/uDesktopDuplication/Shaders/uDD_Unlit.shader index d07900b..55ca19d 100644 --- a/Assets/uDesktopDuplication/Shaders/uDD_Unlit.shader +++ b/Assets/uDesktopDuplication/Shaders/uDD_Unlit.shader @@ -5,6 +5,7 @@ Properties { _Color ("Color", Color) = (1, 1, 1, 1) _MainTex ("Texture", 2D) = "white" {} + _CursorTex ("Cursor Texture", 2D) = "white" {} [KeywordEnum(Off, Y, Z)] _Bend("Bending", Int) = 0 [PowerSlider(10.0)]_Radius ("Radius", Range(1, 100)) = 30 [KeywordEnum(Off, Front, Back)] _Cull("Culling", Int) = 2 diff --git a/Plugins/uDesktopDuplication/uDesktopDuplication/Cursor.cpp b/Plugins/uDesktopDuplication/uDesktopDuplication/Cursor.cpp index 3b223b5..6ecbcbc 100644 --- a/Plugins/uDesktopDuplication/uDesktopDuplication/Cursor.cpp +++ b/Plugins/uDesktopDuplication/uDesktopDuplication/Cursor.cpp @@ -165,8 +165,8 @@ void Cursor::UpdateTexture() const int i = row * w + col; const BYTE andMask = apiBuffer_[col / 8 + row * p] & mask; const BYTE xorMask = apiBuffer_[col / 8 + (row + h) * p] & mask; - const UINT andMask32 = andMask ? 0xFFFFFFFF : 0xFF000000; - const UINT xorMask32 = xorMask ? 0x00FFFFFF : 0x00000000; + const UINT andMask32 = andMask ? 0xFFFFFFFF : 0x00000000; + const UINT xorMask32 = xorMask ? 0xFFFFFFFF : 0x00000000; output32[i] = (desktop32[row * desktopPitch + col] & andMask32) ^ xorMask32; mask = (mask == 0x01) ? 0x80 : (mask >> 1); }