hmm... never heard of flip(). It sound interesting, so I'll probably look it up.
But still, you haven't really got the point about not just making dcBack an exact copy of dcBitmap. What I mean is that if I don't just want to display one bitmap, then stop redrawing the screen... well, to erase the screen, you draw a big rectangle. Then you BitBlt() a bitmap or something on top of the rectangle. Then, you stick that on the screen. That way you can just keep drawing the updated image all the time. But if you only have the bitmap in dcBack, then you will have to erase the screen before BitBlt()'ing the bitmap on... If you're only updating the screen once in a while it's ok, but for Space Invaders it has to be updated every like, .2 second. That's where it flickers, because the screen gets erased so you don't see the bitmap, then the bitmap gets drawn back, so you see it... and so on.
But if I have the rectangle AND the bitmap already on top of it, and BitBlt() the completed image to the screen, then the bitmap never disappears.
I don't know about the memcopy(). Use BitBlt()
I would say you have a problem in one of your BitBlt() or Create__ (CreateCompatibleBitmap() ect ) lines.
The black image is a 'not init' bitmap (like an array has rubbish in it till you fill it). Have you used bitmap with anything on it?
Try painting it with
FillRect() or FrameRect()
or use the WHITENESS flag as the last param of BitBlt() to set the bitmap white.
Remember to 'catch' all GDI resources (fonts, brush, bitmap ect) returned from SelectObject() and replace before DeleteDC() or ReleaseDC() is called. Remember that the DC may contain a bitmap when created.
The reason to use a screen buffer system is, apart from what you have pointed out, so small areas of the screen can be updated without the whole having to be redrawn. In fact the app can be drawing to the buffer in one thread, drawing to the screen with another, while collecting user input with a third.
ahhhh, never mind. The problem was: when I was creating something (I think it was the bitmap) I used a RECT structure, but instead of using scrnRect.bottom for the height, I used scrnRect.left. So the problem was... the bitmap (or whatever it was, I can't remember right now) had a height of 0 :P