remove unused code.
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -87,7 +87,7 @@ public static class Lib
|
|||||||
[DllImport("uDesktopDuplication")]
|
[DllImport("uDesktopDuplication")]
|
||||||
public static extern void Finalize();
|
public static extern void Finalize();
|
||||||
[DllImport("uDesktopDuplication")]
|
[DllImport("uDesktopDuplication")]
|
||||||
public static extern void Reinitialize(bool useThread);
|
public static extern void Reinitialize();
|
||||||
[DllImport("uDesktopDuplication")]
|
[DllImport("uDesktopDuplication")]
|
||||||
public static extern void Update();
|
public static extern void Update();
|
||||||
[DllImport("uDesktopDuplication")]
|
[DllImport("uDesktopDuplication")]
|
||||||
@@ -113,8 +113,6 @@ public static class Lib
|
|||||||
[DllImport("uDesktopDuplication")]
|
[DllImport("uDesktopDuplication")]
|
||||||
public static extern int GetTotalHeight();
|
public static extern int GetTotalHeight();
|
||||||
[DllImport("uDesktopDuplication")]
|
[DllImport("uDesktopDuplication")]
|
||||||
public static extern void SetTimeout(int timeout);
|
|
||||||
[DllImport("uDesktopDuplication")]
|
|
||||||
public static extern IntPtr GetRenderEventFunc();
|
public static extern IntPtr GetRenderEventFunc();
|
||||||
[DllImport("uDesktopDuplication")]
|
[DllImport("uDesktopDuplication")]
|
||||||
public static extern int GetId(int id);
|
public static extern int GetId(int id);
|
||||||
|
|||||||
@@ -55,10 +55,7 @@ public class Manager : MonoBehaviour
|
|||||||
[Tooltip("Debug mode is not applied while running.")]
|
[Tooltip("Debug mode is not applied while running.")]
|
||||||
[SerializeField] DebugMode debugMode = DebugMode.File;
|
[SerializeField] DebugMode debugMode = DebugMode.File;
|
||||||
|
|
||||||
[SerializeField] int desktopDuplicationApiTimeout = 0;
|
|
||||||
[SerializeField] float retryReinitializationDuration = 1f;
|
[SerializeField] float retryReinitializationDuration = 1f;
|
||||||
[SerializeField]
|
|
||||||
bool useThread = false;
|
|
||||||
|
|
||||||
private Coroutine renderCoroutine_ = null;
|
private Coroutine renderCoroutine_ = null;
|
||||||
private bool shouldReinitialize_ = false;
|
private bool shouldReinitialize_ = false;
|
||||||
@@ -99,7 +96,6 @@ public class Manager : MonoBehaviour
|
|||||||
Lib.SetLogFunc(onDebugLog);
|
Lib.SetLogFunc(onDebugLog);
|
||||||
Lib.SetErrorFunc(onDebugErr);
|
Lib.SetErrorFunc(onDebugErr);
|
||||||
|
|
||||||
Lib.SetTimeout(desktopDuplicationApiTimeout);
|
|
||||||
Lib.Initialize();
|
Lib.Initialize();
|
||||||
|
|
||||||
CreateMonitors();
|
CreateMonitors();
|
||||||
@@ -145,7 +141,7 @@ public class Manager : MonoBehaviour
|
|||||||
public void Reinitialize()
|
public void Reinitialize()
|
||||||
{
|
{
|
||||||
Debug.Log("[uDD] Reinitialize");
|
Debug.Log("[uDD] Reinitialize");
|
||||||
Lib.Reinitialize(useThread);
|
Lib.Reinitialize();
|
||||||
CreateMonitors();
|
CreateMonitors();
|
||||||
if (onReinitialized != null) {
|
if (onReinitialized != null) {
|
||||||
onReinitialized();
|
onReinitialized();
|
||||||
|
|||||||
@@ -72,6 +72,16 @@ void MonitorManager::Finalize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MonitorManager::Update()
|
||||||
|
{
|
||||||
|
if (isReinitializationRequired_)
|
||||||
|
{
|
||||||
|
Reinitialize();
|
||||||
|
isReinitializationRequired_ = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void MonitorManager::RequireReinitilization()
|
void MonitorManager::RequireReinitilization()
|
||||||
{
|
{
|
||||||
isReinitializationRequired_ = true;
|
isReinitializationRequired_ = true;
|
||||||
@@ -126,28 +136,6 @@ std::shared_ptr<Cursor> MonitorManager::GetCursor() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MonitorManager::Update()
|
|
||||||
{
|
|
||||||
if (isReinitializationRequired_)
|
|
||||||
{
|
|
||||||
Reinitialize();
|
|
||||||
isReinitializationRequired_ = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MonitorManager::SetTimeout(int timeout)
|
|
||||||
{
|
|
||||||
timeout_ = timeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int MonitorManager::GetTimeout() const
|
|
||||||
{
|
|
||||||
return timeout_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int MonitorManager::GetMonitorCount() const
|
int MonitorManager::GetMonitorCount() const
|
||||||
{
|
{
|
||||||
return static_cast<int>(monitors_.size());
|
return static_cast<int>(monitors_.size());
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public:
|
|||||||
explicit MonitorManager(LUID unityAdapterLuid_);
|
explicit MonitorManager(LUID unityAdapterLuid_);
|
||||||
~MonitorManager();
|
~MonitorManager();
|
||||||
void Reinitialize();
|
void Reinitialize();
|
||||||
|
void Update();
|
||||||
bool HasMonitorCountChanged() const;
|
bool HasMonitorCountChanged() const;
|
||||||
void RequireReinitilization();
|
void RequireReinitilization();
|
||||||
void SetCursorMonitorId(int id) { cursorMonitorId_ = id; }
|
void SetCursorMonitorId(int id) { cursorMonitorId_ = id; }
|
||||||
@@ -27,13 +28,6 @@ private:
|
|||||||
void Initialize();
|
void Initialize();
|
||||||
void Finalize();
|
void Finalize();
|
||||||
|
|
||||||
// Setters from Unity
|
|
||||||
public:
|
|
||||||
void Update();
|
|
||||||
void SetTimeout(int timeout);
|
|
||||||
int GetTimeout() const;
|
|
||||||
|
|
||||||
// Getters from Unity
|
|
||||||
public:
|
public:
|
||||||
int GetMonitorCount() const;
|
int GetMonitorCount() const;
|
||||||
int GetTotalWidth() const;
|
int GetTotalWidth() const;
|
||||||
@@ -42,7 +36,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
LUID unityAdapterLuid_;
|
LUID unityAdapterLuid_;
|
||||||
|
|
||||||
int timeout_ = 10;
|
|
||||||
bool enableTextureCopyFromGpuToCpu_ = false;
|
bool enableTextureCopyFromGpuToCpu_ = false;
|
||||||
std::vector<std::shared_ptr<Monitor>> monitors_;
|
std::vector<std::shared_ptr<Monitor>> monitors_;
|
||||||
std::shared_ptr<Cursor> cursor_ = std::make_shared<Cursor>();
|
std::shared_ptr<Cursor> cursor_ = std::make_shared<Cursor>();
|
||||||
|
|||||||
@@ -182,12 +182,6 @@ extern "C"
|
|||||||
return g_manager->GetTotalHeight();
|
return g_manager->GetTotalHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
UNITY_INTERFACE_EXPORT void UNITY_INTERFACE_API SetTimeout(int timeout)
|
|
||||||
{
|
|
||||||
if (!g_manager) return;
|
|
||||||
g_manager->SetTimeout(timeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
UNITY_INTERFACE_EXPORT void UNITY_INTERFACE_API GetId(int id)
|
UNITY_INTERFACE_EXPORT void UNITY_INTERFACE_API GetId(int id)
|
||||||
{
|
{
|
||||||
if (!g_manager) return;
|
if (!g_manager) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user