initial commit.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6cafb37e09eca694285c387022c33179
|
||||
folderAsset: yes
|
||||
timeCreated: 1477544983
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 168bfc51ae38cb945b9cbb64e3c15a3a
|
||||
folderAsset: yes
|
||||
timeCreated: 1452486970
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c181d333a7bee7a44b94c0f4e02c4bd4
|
||||
timeCreated: 1452176604
|
||||
licenseType: Pro
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82fa7e3d8c4d04f429e44f2a44f7c94a
|
||||
folderAsset: yes
|
||||
timeCreated: 1452530215
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02fc121822cf2ea4e82e16c4a28bf711
|
||||
timeCreated: 1477546714
|
||||
licenseType: Pro
|
||||
PluginImporter:
|
||||
serializedVersion: 1
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
platformData:
|
||||
Any:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
Editor:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4916b05f682614c478174c4863f32ca2
|
||||
folderAsset: yes
|
||||
timeCreated: 1452486965
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f9bfdaaf005950544860a1f6efad2925
|
||||
timeCreated: 1452176573
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1d35b933a9534f04991d5fd4d32b59fc
|
||||
folderAsset: yes
|
||||
timeCreated: 1452486935
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,62 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class uDesktopDuplication : MonoBehaviour
|
||||
{
|
||||
[DllImport("uDesktopDuplication")]
|
||||
private static extern void Initialize();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
private static extern int GetWidth();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
private static extern int GetHeight();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
private static extern bool IsPointerVisible();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
private static extern int GetPointerX();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
private static extern int GetPointerY();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
private static extern int SetTexturePtr(IntPtr ptr);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
private static extern IntPtr GetRenderEventFunc();
|
||||
|
||||
public bool isPointerVisible = false;
|
||||
public int pointerX = 0;
|
||||
public int pointerY = 0;
|
||||
|
||||
Coroutine renderCoroutine_ = null;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
var tex = new Texture2D(GetWidth(), GetHeight(), TextureFormat.BGRA32, false);
|
||||
GetComponent<Renderer>().sharedMaterial.mainTexture = tex;
|
||||
|
||||
SetTexturePtr(tex.GetNativeTexturePtr());
|
||||
renderCoroutine_ = StartCoroutine(OnRender());
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
if (renderCoroutine_ != null) {
|
||||
StopCoroutine(renderCoroutine_);
|
||||
renderCoroutine_ = null;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
isPointerVisible = IsPointerVisible();
|
||||
pointerX = GetPointerX();
|
||||
pointerY = GetPointerY();
|
||||
}
|
||||
|
||||
IEnumerator OnRender()
|
||||
{
|
||||
for (;;) {
|
||||
yield return new WaitForEndOfFrame();
|
||||
GL.IssuePluginEvent(GetRenderEventFunc(), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb54a34570e4747429b1c5b66c69d356
|
||||
timeCreated: 1452445649
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user