Skip to content

Commit

Permalink
reset texture when incompatible size detected #12.
Browse files Browse the repository at this point in the history
  • Loading branch information
hecomi committed Nov 2, 2019
1 parent 3a9cc8b commit 0a57521
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
Binary file modified Plugins/x86/uWindowCapture.dll
Binary file not shown.
Binary file modified Plugins/x86_64/uWindowCapture.dll
Binary file not shown.
1 change: 1 addition & 0 deletions Scripts/UwcLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public enum MessageType
CursorCaptured = 5,
Error = 1000,
TextureNullError = 1001,
TextureSizeError = 1002,
}

[StructLayout(LayoutKind.Sequential)]
Expand Down
9 changes: 8 additions & 1 deletion Scripts/UwcManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,14 @@ void UpdateMessages()
case MessageType.TextureNullError: {
var window = Find(id);
if (window != null) {
window.onCaptured.Invoke();
window.ResetWindowTexture();
}
break;
}
case MessageType.TextureSizeError: {
var window = Find(id);
if (window != null) {
window.ResetWindowTexture();
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion Scripts/UwcWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void CreateWindowTexture(bool force = false)
{
var w = width;
var h = height;
if (w == 0 || h == 0) return;
if (w <= 0 || h <= 0) return;

if (force || !texture || texture.width != w || texture.height != h) {
if (backTexture_) {
Expand Down

0 comments on commit 0a57521

Please sign in to comment.