Skip to main content
gamedev.net
🔒 Locked

difference from LPRECT and RECT

Started by OoMMMoO 2 replies 2.9k views
Original Post
OoMMMoO
OoMMMoO
Can someone tell me the difference between LPRECT and RECT. Im trying to make a clipper for the edges of the screen and in Lamothes code he uses LPRECT clip_list in his attach clipper function but I dont want to make a function I just want to set up the clipper in my GameInit() function but when I go RECT cliplist; cliplist.left=0; ect.. memcpy(region_data->Buffer,clip_list,sizeof(RECT)); it says it cannot convert clip_list to RECT can someone help me?
djsteffey
djsteffey
    
RECT clipList;
clipList.left = 0;
// etc........

memcpy(region_data->Buffer, &clipList, sizeof(RECT));

notice the ampersand before clipList


"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

OoMMMoO
OoMMMoO
When I do that my whole screen turn the color of the last thing I blitted, Do I set the clipper evertime I flip or do I just set it once?

Some of my code is

    
LPDIRECTDRAWCLIPPER lpddclipper;
LPRGNDATA region_data;
RECT clipper_rect;

clipper_rect.bottom= 600;
clipper_rect.top= 0;
clipper_rect.right= 800;
clipper_rect.left= 0;

lpdd->CreateClipper(0,&lpddclipper,NULL);

region_data=(LPRGNDATA)malloc(sizeof(RGNDATAHEADER)+sizeof(RECT));

memcpy(region_data->Buffer,&clipper_rect,sizeof(RECT));

region_data->rdh.dwSize= sizeof(RGNDATAHEADER);
region_data->rdh.iType= RDH_RECTANGLES;
region_data->rdh.nCount= 1;
region_data->rdh.nRgnSize= sizeof(RECT);

region_data->rdh.rcBound.left= 64000;
region_data->rdh.rcBound.top= 64000;
region_data->rdh.rcBound.right= -64000;
region_data->rdh.rcBound.bottom=-64000;

lpddclipper->SetClipList(region_data,0);
lpddsback->SetClipper(lpddclipper);

free(region_data);


Edited by - OoMMMoO on October 20, 2000 6:58:37 PM
DekuTree64
DekuTree64
Just set it once. Oh, and I think you need to wait until after you release the clipper to free region_data. Not sure though.



-Deku-chan

DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^)

"I'm dropping like flies!" - me, playing Super Smash Bros. (and losing)
"What fun!" - me, playing Super Smash Bros. (and beating the crap out of somebody)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.