D.V.D
Make a wish
- Reaction score
- 73
I made a simple function to see how fast my cpu can draw a decent chunk of the screen a certian color. The thing I found out is, using the SetPixel function to do it is extremely slow. So how do games do it? How is drawing a bitmap any faster than setting the pixels?
Code:
void drawlots(HDC hdc) {
COLORREF col=RGB(0,0,0);
for (short i=0; i<1000;i++){
for (short y=0;y<500;y++) {
SetPixel(hdc,i,y,col);
}
}
}