在 winAPI 中切换 *pointers 而不是使用 BitBlt()?
Switching *pointers instead of using BitBlt() in winAPI?
据我所知,来自 winAPI 的 winGDI 的 BitBlt() 函数是将一些图像放在屏幕上最快的函数。
但是“blitting”只是将内存从一个源复制到一个目的地。
所以我想知道,为什么我们不能只拥有两个位图(缓冲区)并且只切换指向当前缓冲区(如果它已完成)的指针。像双缓冲。它会比 mem copiyng 更快。
在 winAPI 中可以吗?
BitBlt method in GDI is to copy the contents of the back buffer to the redirection surface. A more efficient method has been implemented in directx.
The runtime uses the bit-block transfer (bitblt) and flip presentation
models to present graphics content on display monitors. The biggest
difference between bitblt and flip presentation models is how
back-buffer contents get to the Windows 8 DWM for composition. In the
bitblt model, contents of the back buffer are copied into the
redirection surface on each call to IDXGISwapChain1::Present1. In the
flip model, all back buffers are shared with the Desktop Window
Manager (DWM). Therefore, the DWM can compose straight from those back
buffers without any additional copy operations. In general, the flip
model is more efficient. The flip model also provides more features,
such as enhanced present statistics.
If you have legacy components that use Windows Graphics Device
Interface (GDI) to write to an HWND directly, use the bitblt model.
详情请参考:Comparing the DXGI flip model and the BitBlt model
这篇文章也给出了详细的解释
据我所知,来自 winAPI 的 winGDI 的 BitBlt() 函数是将一些图像放在屏幕上最快的函数。 但是“blitting”只是将内存从一个源复制到一个目的地。
所以我想知道,为什么我们不能只拥有两个位图(缓冲区)并且只切换指向当前缓冲区(如果它已完成)的指针。像双缓冲。它会比 mem copiyng 更快。
在 winAPI 中可以吗?
BitBlt method in GDI is to copy the contents of the back buffer to the redirection surface. A more efficient method has been implemented in directx.
The runtime uses the bit-block transfer (bitblt) and flip presentation models to present graphics content on display monitors. The biggest difference between bitblt and flip presentation models is how back-buffer contents get to the Windows 8 DWM for composition. In the bitblt model, contents of the back buffer are copied into the redirection surface on each call to IDXGISwapChain1::Present1. In the flip model, all back buffers are shared with the Desktop Window Manager (DWM). Therefore, the DWM can compose straight from those back buffers without any additional copy operations. In general, the flip model is more efficient. The flip model also provides more features, such as enhanced present statistics.
If you have legacy components that use Windows Graphics Device Interface (GDI) to write to an HWND directly, use the bitblt model.
详情请参考:Comparing the DXGI flip model and the BitBlt model
这篇文章也给出了详细的解释