Public Group

#### Archived

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

# Direct draw clippers...

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

## 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:


LPDIRECTDRAWCLIPPER clipper;

// in the constructor:

clipper = NULL;

// in the init_ddraw function

hRet = ddraw_obj->CreateClipper(0, clipper, NULL);
/*...*/
hRet = clipper->SetHWnd(0, hWnd);


##### Share on other sites
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 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 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 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 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 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 on other sites
Use (LPDIRECTDRAWCLIPPER*)&clipper, since the function returns the pointer to the newly created clipper.

##### Share on other sites
*thwacks self*

thank you...I feel stupid now...

now to track down a different error...

##### 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!!!

1. 1
2. 2
3. 3
Rutin
19
4. 4
5. 5

• 10
• 14
• 30
• 13
• 11
• ### Forum Statistics

• Total Topics
631785
• Total Posts
3002346
×

## Important Information

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!