Skip to main content
gamedev.net
🔒 Locked

DIrect Draw Object Creation

Started by KlePt0 3 replies 350+ views
Original Post
KlePt0
KlePt0
Seeing as how there are only parameters for DirectDrawCreate, and 2 are NULL, i''m just wondering how i could get a DDERR_INVALIDPARAMS error. I''m making the switch from VB to VC(i do know ansii-c though)
Bobby Ward - COM Guru in training
Sandman
Sandman
I would guess that the one that isnt NULL is probably wrong..

code?
KlePt0
KlePt0
sorry should have put this up here earlier

/**********************************************************/
HRESULT hr = DirectDrawCreate(NULL, &m_pDDObject, NULL) ;

if (FAILED(hr) || NULL == m_pDDObject)
{
MessageBox(hWndApp,
TEXT(DDErrorString(hr)),
TEXT("Error"), MB_OK | MB_ICONSTOP) ;
return FALSE ;
}

return TRUE;
/***********************************************************/

this first parameter is a guid to a device. Setting it to null uses the default device

the second is a pointer to a dd object(actually **dd)

the last is ?pUnkOuter?
don''t know what it is but setting it to anything but null causes an error

so i''m lost as to what the invalid parameter could be

Bobby Ward - COM Guru in training
Sandman
Sandman
What kind of ddraw object are you trying to create? If it is anything other than a basic DirectDraw1 object, that would probably be the problem. If you want to create a DirectX 7 interface, you have to use DirectDrawCreateEx()





Edited by - Sandman on April 18, 2001 1:39:50 PM
KlePt0
KlePt0
I got the program to go to exclusive mode( directdraw is completely inside a class and i forgot the " = new") and it does a colorfill of the back and flips during idle time, everytime returning DD_OK. I now have a bitmap loaded into an offscreen surface using DDLoadBitmap( again its returning DD_OK everywhere ).

I do know directx so i have been rather cautious about return values but maybe i'm missing something to do with DDLoadBitmap. Do i have to create the surface first then load the bitmap or is it something to do with front buffer. I also tried both blt and bltfast but i've heard talk of StretchBlt but i believe its external to DDraw.

Also if anyone knows of any sites that deal with this subject a little more than most tutorials, that would probably help alot. I'm working on a Full Motion Video game and bitmaps are the only thing i need for my main menu, DirectShow was actuallt easier to get working usind an overlay mixer( just derived a class from the base classes ). But VC++ is still a little new to me, so i might be missing something that seems obvious to you.

Do i have to setup the palette before i blt?

( i'm not sure if its direcdraw7 but its the object the overlay mixer uses )

Edited by - KlePt0 on April 18, 2001 3:10:07 PM
Bobby Ward - COM Guru in training

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.