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