Skip to content

Commit f3b42d8

Browse files
committed
output debug log related to texture error.
1 parent 02b61b9 commit f3b42d8

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Assets/uWindowCapture/Scripts/UwcWindow.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,14 @@ void CreateWindowTexture(bool force = false)
350350
if (backTexture_) {
351351
Object.DestroyImmediate(backTexture_);
352352
}
353-
backTexture_ = new Texture2D(w, h, TextureFormat.BGRA32, false);
354-
Lib.SetWindowTexturePtr(id, backTexture_.GetNativeTexturePtr());
355-
willTextureSizeChange_ = true;
353+
try {
354+
backTexture_ = new Texture2D(w, h, TextureFormat.BGRA32, false);
355+
Lib.SetWindowTexturePtr(id, backTexture_.GetNativeTexturePtr());
356+
willTextureSizeChange_ = true;
357+
} catch (System.Exception e) {
358+
Debug.LogError(e.Message);
359+
Debug.LogErrorFormat("Width: {0}, Height: {1}", w, h);
360+
}
356361
}
357362
}
358363

0 commit comments

Comments
 (0)