Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Buster

DDraw Clippers!! PLEASE KILL ME NOW!

This topic is 6937 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

Ok, I''m going to try one last plea for help before I jump. Has anybody had success attaching a clipper to the back surface while running their app in windowed mode? If you have DDraw do a clipper by using: pClipper->SetHWnd(...); You end up with a clipper sized to the Front buffer, complete with scroll bars, menus etc. So instead of (0,0,800,600), you get (4,24,804,624). Or something like that. Now here''s the fun part. Direct X docs say you need to build a "manual" clip list instead. Has anyone found out how this works? I''ve poured over every piece of printed docs from MS and have found nothing on actually building a clip list. They talk about the structures involved (RGNDATA and RGNDATAHEADER) but that''s it. -Michael

Share this post


Link to post
Share on other sites
Advertisement
I''m not sure if this will help you, but I believe it sets up a one-rectangle clip list:
Suggestions to use a custom list of 2 rectangles are in CAPS.

RECT rScreen;

/*
* Create the screen rectangle for Blt() functions
*/
rScreen.left = 0;
rScreen.top = 0;
rScreen.right = nWidth;
rScreen.bottom = nHeight;

/*
* Create a clipper
*/
lpdd->CreateClipper(0, &lpClipper, NULL);
lpRgnData = (LPRGNDATA)malloc(sizeof(RGNDATAHEADER)+sizeof(RECT));
CHANGE TO sizeof(RECT)*2 FOR TWO RECTS
memcpy(lpRgnData->Buffer, &rScreen, sizeof(RECT));
CHANGE TO sizeof(RECT)*2 AGAIN
lpRgnData->rdh.dwSize = sizeof(RGNDATAHEADER);
lpRgnData->rdh.iType = RDH_RECTANGLES;
lpRgnData->rdh.nCount = 1;
CHANGE TO 2
lpRgnData->rdh.nRgnSize = sizeof(RECT);
CHANGE TO sizeof(RECT)*2 AGAIN
memcpy(&lpRgnData->rdh.rcBound, &rScreen, sizeof(RECT));
CHANGE TO sizeof(RECT)*2 ONCE MORE
lpClipper->SetClipList(lpRgnData, 0);
free(lpRgnData);

/*
* Attatch the clipper
*/
lpPrimary->SetClipper(lpClipper);
lpBuffer->SetClipper(lpClipper);


hope it helps

---------------
kieren_j

Share this post


Link to post
Share on other sites
I''m going to give that a try tonight. I have NT server at work, so can''t do it now .

At the end of that code I assume that...
lpPrimary->SetClipper(lpClipper);
lpBuffer->SetClipper(lpClipper);

... are the front and back buffers?

-Michael

Share this post


Link to post
Share on other sites
kieren_j, I hope you read this, because you are now OFFICIALLY MY GOD! The clipper is up and running like a charm... send me your email so I can give you a free copy of the engine when we publish.

BTW, I was missing this line:
memcpy(lpRgnData->Buffer, &rScreen, sizeof(RECT));

I never did figure out why the RECT seems to be kept twice. Once in the Buffer and once in rdh.rcBound.

Oh well!

THANK YOU THANK YOU THANK YOU

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!