I am trying several ways to capture a screen with DirectX, and so far I have come up with 3 methods:
GetFrontBufferData() - Average lead time:GetFrontBufferData(): 0.83598 sD3DXSaveSurfaceToFile(): 0.0036 s- Total: 0.83958 s
GetBackBuffer() - Average lead time:GetBackBuffer(): 0 s <- INTERESTING - WHY?D3DXSaveSurfaceToFile(): 0.2918 s- Total: 0.2918 s
GetRenderTargetData() - Average lead time:GetRenderTargetData(): 0.00928 sD3DXSaveSurfaceToFile(): 0.00354 s- Total: 0.01282 s
The average time was calculated using 50 screenshots and by measuring time using clock().
However, all of the above methods work, as you can see, the execution time varies greatly from one method to another for the same results (apparently).So, I have a few questions:
- Why is runtime different from one method to another?
GetBackBuffer() , D3DXSaveSurfaceToFile() ?
, , :
GetFrontBufferData() , VRAM, /, , .GetBackBuffer() ( D3DXSaveSurfaceToFile()) , VRAM, , .- ,
GetRenderTargetData() , RAM ( VRAM), .
.
EDIT: .