DirectDraw Backbuffer clipping windowed-mode
I'm trying to clip surfaces blitted to a backbuffer for a windowed-mode directdraw application. The problem is that when I attach a clipper to the backbuffer, it clips the surfaces, just not in the right place. I'm using DirectDraw 7.
What happens is it clips the sufaces in a position relative to where the client area of the window is to the desktop. For intance if the client area of the window was at (0, 0) on the desktop, everything looks fine. And if the client area of the window was at (10, 10) the backbuffer clips sprites starting with those coordinates.
Why this is happening does not make sense. I'd appreciate it if someone would explain what I'm doing wrong, or direct me to a sample that clips surfaces being blitted to the backbuffer in a windowed-mode application.