//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);
Direct draw clippers...
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:
thanks in advance!!
___________________
~Analazon
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
___________________
~Analazon
*bump*
I know that this has been asked a million times...and I would use the search if I could...
___________________
~Analazon
I know that this has been asked a million times...and I would use the search if I could...
___________________
~Analazon
I typecasted it as an LPDIRECTDRAWCLIPPER* and it appeared to work. I''m not sure if this is right tho.
___________________
~Analazon
___________________
~Analazon
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.
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.
I revised a bit of my code so that instead of doing the SetHWnd, I used the one RGNDATA structure. Should work now...
___________________
~Analazon
___________________
~Analazon
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.
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.
Use (LPDIRECTDRAWCLIPPER*)&clipper, since the function returns the pointer to the newly created clipper.
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.
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!!!
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!!!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement