go-d3d
go-d3d copied to clipboard
Failures and botched up video output on multiple monitor setup
I have 2 monitors in extended mode.
- 2560 x 1440 px
- 1920 x 1080 px
Context: I'm running the mjpegstream example
If I just use any one of these then its fine but the program just fails when I have both connected and I try to record from the primary (index 0) monitor! This is the failure output -
Registering stream 0
Registering stream 1
Enabled PerMonitorAwareV2 DPI awareness.
Enabled PerMonitorAwareV2 DPI awareness.
panic: runtime error: slice bounds out of range [8304640:8294400]
goroutine 8 [running, locked to thread]:
github.com/kirides/go-d3d/outputduplication.(*OutputDuplicator).GetImage(0xc000132000, 0xc00007e280, 0x10afca0?)
C:/Users/.../go/pkg/mod/github.com/kirides/[email protected]/outputduplication/output_duplication.go:253 +0x25e
main.streamDisplayDXGI({0x10b1fe8, 0xc00007e240}, 0x0, 0x19, 0x0?)
I:/code/...go:157 +0x579
created by main.main in goroutine 1
I:/code/...go:63 +0x2d1
exit status 2
But on non-primary monitor I get output like this -
The error occurs here -> https://github.com/kirides/go-d3d/blob/afb04af3689873e4548c205d89026a26b0524efb/outputduplication/output_duplication.go#L253