简体   繁体   中英

Fast pixel drawing on the screen

I need to fill a window with pixels, very fast of course. This is for an 'old school' project with software 3D graphics (proof of concept).

The requirements are:

  • Pointer to the screen buffer to write colors and a method to display it

  • No OpenGL, Direct3D or SDL

  • Pure WinAPI

Question: How do I draw pixels on a window with WinAPI?

  • CreateDIBSection to create a HBITMAP bitmap with handle along with raw pointer to bits
  • BitBlt to copy data between HDC device contexts, from a device context with the bitmap (see above) selected into, to the other one associated with the window you are to "paint on"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM