Newbie Using a Clipper
I am using the CDisplay and CSurface wrapper classes that come with DirectX.
I am working in windowed mode and am trying to apply a clipper to the m_BackBuffer surface in order to updated specific rectangles on the surface before blt''ing to the m_FrontBuffer.
I am using the following code but when I do it doesn''t allow me to write anything to the surface. Can anyone see what I am doing wrong?
//create direct draw clipper
LPDIRECTDRAWCLIPPER pddclip;
m_pDisplay->GetDirectDraw()->CreateClipper(0,&pddclip,NULL);
//create the clip region
HRGN hrgn = CreateRectRgn(0, 0, 800, 640);
DWORD dwBufSize = GetRegionData(hrgn,0,NULL);
LPRGNDATA lprd = (LPRGNDATA)malloc(dwBufSize);
GetRegionData(hrgn,dwBufSize,lprd);
pddclip->SetClipList(lprd,0);
//attach the clipper to the BackBuffer before blt''ing to it
m_pDisplay->GetBackBuffer()->SetClipper(pddclip);
Thanks for the help!
Todd
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement