Skip to content

Releases: hecomi/uWindowCapture

v0.2.0 Released

30 Dec 13:19
Compare
Choose a tag to compare
v0.2.0 Released Pre-release
Pre-release

Update

  • Add GetPixels() / GetPixel() APIs.
  • Add GetBuffer() API

Examples

Scenes

GetPixels and Buffer scenes were added as example projects.

GetPixels scene

getpixels

Buffer scene

buffer

GetPixels()

UwcWindowTexture uwcTexture;
public Texture2D texture;
Color32[] colors;

...

colors = new Color32[w * h];
texture = new Texture2D(w, h, TextureFormat.RGBA32, false);

if (uwcTexture.window.GetPixels(colors, x, y, w, h)) {
    texture.SetPixels32(colors);
    texture.Apply();
}

GetPixel()

UwcWindowTexture uwcTexture;
...
var window = uwcTexture.window;
var x = cursorPos.x - window.x;
var y = cursorPos.y - window.y;
material_.color = window.GetPixel(x, y);

Buffer

UwcWindowTexture uwcTexture;
...

var window = uwcTexture.window;
var width = window.width;
var height = window.height;

texture_ = new Texture2D(width, height, TextureFormat.RGBA32, false);
texture_.filterMode = FilterMode.Bilinear;
pixels_ = texture_.GetPixels32();
handle_ = GCHandle.Alloc(pixels_, GCHandleType.Pinned);
ptr_ = handle_.AddrOfPinnedObject();
GetComponent<Renderer>().material.mainTexture = texture_;

var buffer = window.buffer;
memcpy(ptr_, buffer, width * height * sizeof(Byte) * 4);

texture_.SetPixels32(pixels_);
texture_.Apply();

v0.1.2 Released

23 Nov 02:51
Compare
Choose a tag to compare
v0.1.2 Released Pre-release
Pre-release

Bug Fix

  • Check whether the target window is fullscreen or not for the better alt-tab-window detection.

v0.1.1 Released

02 Oct 14:31
Compare
Choose a tag to compare
v0.1.1 Released Pre-release
Pre-release

Changes

Search Timing

With the previous version, we had to search for an another window by partialWindowTitle manually when the target window is lost. From now, we can customize the update timing from the inspector of UwcWindowTexture.

search timing

  • Always
    • search for a window by partialWindowTitle every frame and use the first window from the list.
  • Manual
    • you have to set shouldUpdateWindow property manually to search and set a new window.
  • Only When Parameter Changed (default)
    • search for a window only when one of some parameters like type, partialWindowTitle, and altTabWindows is changed.

Update Titles

UwcManager has a new field, windowTitlesUpdateTiming , which is able to change the timing to update titles of windows.

window titles

  • Manual (default and same as the behavior of the previous version, lightest)
    • you have to call UwcManager.UpdateAllWindows() or UwcManager.UpdateAltTabWindows() manually when you want to update titles of windows.
  • AlwaysAllWindows (heavier than Manual)
    • call UpdateAllWindows() every frame.
  • AlwaysAltTabWindows (heaviest)
    • call UpdateAltTabWindows() every frame.

v0.1.0 Released

06 Sep 16:31
Compare
Choose a tag to compare
v0.1.0 Released Pre-release
Pre-release

Update

  • add uWindowCapture.RayCastResult UwcWindow.RayCast(Vector3 from, Vector3 dir, float distance, LayerMask layerMask)

raycast2

UwcRayCastExample.cs

using UnityEngine;

public class UwcRayCastExample : MonoBehaviour
{
    [SerializeField]
    Transform from;

    [SerializeField]
    Transform to;

    [SerializeField]
    LayerMask layerMask;

    [SerializeField]
    Vector2 windowCoord;

    [SerializeField]
    Vector2 desktopCoord;

    void Update()
    {
        var from2to = to.position - from.position;
        var dir = from2to.normalized;
        var distance = from2to.magnitude;
        var result = UwcWindowTexture.RayCast(from.position, dir, distance, layerMask);
        if (result.hit) {
            Debug.DrawLine(from.position, to.position, Color.red);
            Debug.DrawRay(result.position, result.normal, Color.green);
            windowCoord = result.windowCoord;
            desktopCoord = result.desktopCoord;
        } else {
            Debug.DrawLine(from.position, to.position, Color.yellow);
            windowCoord = new Vector2(-1, -1);
            desktopCoord = new Vector2(-1, -1);
        }
    }
}

uWindowCapture v0.0.2 Released

30 Aug 14:20
Compare
Choose a tag to compare
Pre-release

Bug Fix

  • Fix the Capture Mode bug that ignored it and set it as default after playing the game.
  • Fix the cursor position bug when using the BitBlt capture mode.

uWindowCapture Released!

26 Aug 14:01
Compare
Choose a tag to compare
Pre-release
v0.0.1

fix title bug.