roshkins / IddSampleDriver

Add virtual monitors to your windows 10 device! Works with Oculus software, obs, and any desktop sharing software
626 stars 249 forks source link

How can I create 2 virtual displays? #35

Open cuikeqiang opened 1 year ago

cuikeqiang commented 1 year ago

I called the function below twice, but only can create one virtual display, the second time it returned "SwDeviceCreate failed with 0x800700b7". Anyone knows how to create second virtual display? HRESULT hr = SwDeviceCreate(L"IddSampleDriver", L"HTREE\ROOT\0", &createInfo, 0, nullptr, CreationCallback, &hEvent, &hSwDevice);

apexiptv commented 1 year ago

I was wondering same... says it works with 5 virtual

cuikeqiang commented 1 year ago

I was wondering same... says it works with 5 virtual

@apexiptv Try Microsoft's example: https://github.com/microsoft/Windows-driver-samples/blob/main/video/IndirectDisplay/IddSampleDriver/Driver.cpp

It will create 3 displays with different size.

You need to set this one to 3: static constexpr DWORD IDD_SAMPLE_MONITOR_COUNT = 3; // If monitor count > ARRAYSIZE(s_SampleMonitors), we create edid-less monitors

ge9 commented 1 year ago

or you can use my fork , which is also mentioned in README.md in this repo.