This repository was archived by the owner on Mar 30, 2019. It is now read-only.
This repository was archived by the owner on Mar 30, 2019. It is now read-only.
Fastest method for screen capture #777
Open
Description
This is mostly a question.
I currently have the following code that I obtained from a SharpDX example.
// Create DXGI Factory1
var factory = new Factory1();
var adapter = factory.GetAdapter1(0);
// Create device from Adapter
var device = new Device(adapter);
// Get DXGI.Output
var output = adapter.GetOutput(numOutput);
var output1 = output.QueryInterface<Output1>();
// Create Staging texture CPU-accessible
var textureDesc = new Texture2DDescription
{
CpuAccessFlags = CpuAccessFlags.Read,
BindFlags = BindFlags.None,
Format = Format.B8G8R8A8_UNorm,
Width = width,
Height = height,
OptionFlags = ResourceOptionFlags.None,
MipLevels = 1,
ArraySize = 1,
SampleDescription = { Count = 1, Quality = 0 },
Usage = ResourceUsage.Staging
};
var screenTexture = new Texture2D(device, textureDesc);
// Duplicate the output
var duplicatedOutput = output1.DuplicateOutput(device);
I've been reading a lot of about the back buffer and how it is often better to read the back buffer.
Could you please help me get started on how to read from the back buffer?
Also, is there a good study of the latencies of various methods available somewhere?