Win32 PONG problem! [Archive] - C Board

PDA

View Full Version : Win32 PONG problem!


SyntaxBubble
03-10-2002, 02:31 PM
OK, I am doing a Windows PONG and I have a problem. I need to make 2 diff. colored buttons. When I send the WM_PAINT message, my program won't draw the ball. What do I do?


= REQUESTED CODE:

case WM_PAINT:
HDC r;
RECT rr;
r = GetDC (red);
GetClientRect(red, &rr);

FillRect (r, &rr, CreateSolidBrush (RGB (255, 0, 0) ));

ReleaseDC(red, r);
break;

Uraldor
03-10-2002, 08:30 PM
you're just refilling the screen with red aren't you? how about you redraw the ball aswell?

by the way, you should use BeginPaint and EndPaint when handling the WM_PAINT message.. not GetDC and ReleaseDC

U.