|
@@ -33,14 +33,13 @@ static inline bool get_monitor(gs_device_t *device, int monitor_idx,
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
-gs_duplicator::gs_duplicator(gs_device_t *device_, int monitor_idx)
|
|
|
|
- : texture(nullptr), device(device_)
|
|
|
|
|
|
+void gs_duplicator::Start()
|
|
{
|
|
{
|
|
ComPtr<IDXGIOutput1> output1;
|
|
ComPtr<IDXGIOutput1> output1;
|
|
ComPtr<IDXGIOutput> output;
|
|
ComPtr<IDXGIOutput> output;
|
|
HRESULT hr;
|
|
HRESULT hr;
|
|
|
|
|
|
- if (!get_monitor(device, monitor_idx, output.Assign()))
|
|
|
|
|
|
+ if (!get_monitor(device, idx, output.Assign()))
|
|
throw "Invalid monitor index";
|
|
throw "Invalid monitor index";
|
|
|
|
|
|
hr = output->QueryInterface(__uuidof(IDXGIOutput1),
|
|
hr = output->QueryInterface(__uuidof(IDXGIOutput1),
|
|
@@ -53,6 +52,12 @@ gs_duplicator::gs_duplicator(gs_device_t *device_, int monitor_idx)
|
|
throw HRError("Failed to duplicate output", hr);
|
|
throw HRError("Failed to duplicate output", hr);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+gs_duplicator::gs_duplicator(gs_device_t *device_, int monitor_idx)
|
|
|
|
+ : texture(nullptr), device(device_), idx(monitor_idx)
|
|
|
|
+{
|
|
|
|
+ Start();
|
|
|
|
+}
|
|
|
|
+
|
|
gs_duplicator::~gs_duplicator()
|
|
gs_duplicator::~gs_duplicator()
|
|
{
|
|
{
|
|
delete texture;
|
|
delete texture;
|