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?
CreateDIBSectionto create aHBITMAPbitmap with handle along with raw pointer to bitsBitBltto copy data betweenHDCdevice 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”