Jump to content
  • Advertisement

Archived

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

Analazon

Direct draw clippers...

This topic is 5749 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 have my DDraw clipper, and I''m trying to use the function SetHWnd. I tried that, but then my program told me that I hadn''t initalized it yet, so I fire up the help, and check it out. I come across the functiond CreateClipper. This seems to be a good thing, so I put it into my program. I compile, and I get the error that CreateClipper cannot convert parameter 2 from ''struct IDirectDrawClipper*'' to ''struct IDirectDrawClipper**'' Here is all the clipper code that I have, and I think I''m missing some:
  
//in the ddraw_wrapper header file:

LPDIRECTDRAWCLIPPER clipper;

// in the constructor:

clipper = NULL;

// in the init_ddraw function

hRet = ddraw_obj->CreateClipper(0, clipper, NULL);
/*...*/
hRet = clipper->SetHWnd(0, hWnd);
  
thanks in advance!! ___________________ ~Analazon

Share this post


Link to post
Share on other sites
Advertisement
note: if I make clipper a pointer, it gives me an error on clipper->SetHWnd. Says it must point to a class/struct/union...

___________________
~Analazon

Share this post


Link to post
Share on other sites
*bump*

I know that this has been asked a million times...and I would use the search if I could...

___________________
~Analazon

Share this post


Link to post
Share on other sites
I typecasted it as an LPDIRECTDRAWCLIPPER* and it appeared to work. I''m not sure if this is right tho.

___________________
~Analazon

Share this post


Link to post
Share on other sites
humm...you need to:

1) Create the Clipper
2) fill out a LPRGNDATA structure
3) Set the Clip list.

You did the first one...the rest is too mush to explain here...click the "For Beginners" thing above and it should say in there somewhere.

Share this post


Link to post
Share on other sites
I revised a bit of my code so that instead of doing the SetHWnd, I used the one RGNDATA structure. Should work now...

___________________
~Analazon

Share this post


Link to post
Share on other sites
Hmm...a bit of debuging later...

if I use ddraw_obj->CreateClipper(0, (LPDIRECTDRAWCLIPPER*)clipper, NULL); it tells me invalid params. This is getting rather annoying, so if someone could tell me the proper way of doing this, I would appreciate it.

Share this post


Link to post
Share on other sites
dangit...ok, new problem now...

Whenever I use the function BltFast with a RECT structure passed to it, it tells me that it is an invalid rect. If I blt the whole thing, then it works fine (pass NULL for the rectangle), but whenever I use a rectangle, then it return DDERR_INVALID RECT.


  
RECT rcRect;
rcRect.top = 0;
rcRect.bottom = 40;
rcRect.right = 0;
rcRect.bottom = 80;
hRet = back_buffer->BltFast(0,0, thenode->image, &rcRect, DDBLTFAST_NOCOLORKEY);


if NULL is passed instead of rcRect, then it doesn''t work. This is rather annoying, as I have gotten it to work before in another app. Note: thenode->image is a 240*200 image.

GRRR!!!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!