• Advertisement
Sign in to follow this  

please help me with clipping

This topic is 4851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm making a game and so far the animation works fine but I haven't gotten the clipping right yet. When I add the clipping code, the program freezes. Can someone PLEASE help me? I would especially appreciate it if someone would give me the exact code I need to accomplish this. Thanks. I've done internet searches but still can't find any help.

LPDIRECTDRAW7 lpDD;
LPDIRECTDRAWSURFACE7 lpDDSBack;
LPDIRECTDRAWCLIPPER lpDDClipper;

RECT cliprect = {0,0,640,480};
LPRGNDATA rd = (LPRGNDATA)malloc(sizeof(RGNDATAHEADER)
   + sizeof(RECT));

ddrval = lpDD->CreateClipper( 0, lpDDClipper, NULL);
memcpy(rd->Buffer, &cliprect, sizeof(RECT));
rd->rdh.dwSize = sizeof(RGNDATAHEADER);
rd->rdh.iType = RDH_RECTANGLES;
rd->rdh.nCount = 1;
rd->rdh.nRgnSize = sizeof(RECT);
rd->rdh.rcBound.left = 0;
rd->rdh.rcBound.right = 640;
rd->rdh.rcBound.top = 0;
rd->rdh.rcBound.bottom = 480;
ddrval = lpDDClipper->SetClipList(rd,0);
lpDDSBack->SetClipper(lpDDClipper); 
free(rd);


Share this post


Link to post
Share on other sites
Advertisement

This topic is 4851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement