Archived

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

stupid clipper..

This topic is 5828 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 having this weird problem with the directdraw clipper. Before i put up any of my code, i just want to tell you guys what happens and if nobody has any ideas, then i''ll put up the code. Ok, so what happens is this: I attach a clipper to my back buffer, and I have a keyboard controlled character being blitted to the back buffer. Now whenever the character goes of the TOP LEFT of the surface, the whole surface fills up with garbage. I know that I could just put some code to prevent him from going there, but i thought maybe it was something else... So does anybody have any idea what i''m doing wrong? ...go on and live with no regrets, you only have one life...

Share this post


Link to post
Share on other sites
I''d go ahead and post the code... are you positive it only happens when you attached the clipper? Without the code there''s no exact way of telling what''s going on...



Eric

//----------------------------
In a world without boundaries -
who needs gates or windows ?
----------------------------\\

Share this post


Link to post
Share on other sites
ok... i''m not gonna put the code here, cuz its huge, but instead heres a zip that has the .exe, the .cpp, the pic of the guy, and a screenshot of what happens..(if you want to run the .exe, put the guy.bmp in "c:\windows\desktop\c++\ex"... ok, have fun trying to help me.

http://www.geocities.com/untalkative_monkey/junk.zip

...go on and live with no regrets, you only have one life...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Well I see here your working out of the book "Tricks of the Game Windows Programming Gurus"

Yeah his clipper was pretty messed.

Here''s what you should do - try this:

This is all the code you need to attaching a clipper to your backbuffer.

// Create a clipper for the entire display
lpdd->CreateClipper(0, &lpddclipper, NULL);

// Set the clipper to clip the entire window
lpddclipper->SetHWnd(0, hwnd);

// Attach the clipper to the backbuffer surface
lpddsback->SetClipper(lpddclipper);

Simple enough?

Hope it works!

Share this post


Link to post
Share on other sites
Well I see here your working out of the book "Tricks of the Game Windows Programming Gurus"

Yeah his clipper was pretty messed.

Here''s what you should do - try this:

This is all the code you need to attaching a clipper to your backbuffer.

// Create a clipper for the entire display
lpdd->CreateClipper(0, &lpddclipper, NULL);

// Set the clipper to clip the entire window
lpddclipper->SetHWnd(0, hwnd);

// Attach the clipper to the backbuffer surface
lpddsback->SetClipper(lpddclipper);

Simple enough?

Hope it works!

Eric

//----------------------------
In a world without boundaries -
who needs gates or windows ?
----------------------------\\

Share this post


Link to post
Share on other sites