h_howee 0 Newbie Poster

[edit]how did this end up in the virus and spyware section...[/edit]

'm working on a "breakout" game and everything worked fine until i tried to add in double buffering.
I tried to take out double buffering since i couldn't get it to work and now, it draws everything from the top left corner of the screen instead of in the client area.
g_hwnd isnt 0

This is the code that's doing the drawing

void C_Graphics::DrawAll(C_Brick Bricks[])
{
    hbr = CreateSolidBrush(RGB(0,0,0));
    RECT r;
    r = Player.Get_BallInfo();
    Ellipse(hdc, r.left, r.top, r.right, r.bottom);
    FillRect(hdc, Player.Get_PlankInfo(), hbr);
    for(int i = 0; i < 20; i++)
    {
        if (Bricks[i].Get_Life() > 0)
            FillRect(hdc, Bricks[i].Get_Info_ptr(), hbr);
    }
    DeleteObject(hbr);
}

void C_Graphics::ClearScreen()
{
    hbr = CreateSolidBrush(RGB(255, 255, 255));
    RECT r;
    GetClientRect(g_hwnd, &r);
    FillRect(hdc, &r, hbr);
    DeleteObject(hbr);
}

http://cboard.cprogramming.com/showthread.php?t=87786