Jump to content
  • Advertisement


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


Initialising Direct Draw 7

This topic is 5879 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

Hi im trying to understand the creation of a Direct Draw Com object and ive been using Teej''s Tetris Tutorial forum which is excellent but unfortunately isnt being updated anymore. So im going to have to ask for help here. I understand the need to create a com object and the use of its interfaces etc but i dont understand the first step of creating one. Teejs tutorial and loads of others state something like this As quoted from the tutorial: The main COM interface for DirectDraw is called IdirectDraw7. Note that we’re using DirectX 7.0 components in this tutorial, so the first line asks for this interface: // Create our DirectDraw object hRet = DirectDrawCreateEx(NULL, (void**)&G.lpDD, IID_IDirectDraw7, NULL); if (FAILED(hRet)) return -1; Here’s the prototype for this function: extern HRESULT WINAPI DirectDrawCreateEx( GUID FAR * lpGuid, LPVOID *lplpDD, REFIID iid,IUnknown FAR *pUnkOuter ); OK SO FAR SO GOOD. I understand the pointer to pointer business (second argument) but that understanding stops here when teej follows on with If you look in GLOBALS.H, here’s what we currently have for our DirectDraw object: LPDIRECTDRAW lpDD; As you can guess, this is a pointer already (we usually use ‘p’ or ‘lp’ to denote ‘pointer’). HANG ON A MINUTE.... is teej saying that lpDD is a pointer. If he is then where is the * notation whch is used to declare a pointer?? DirectDrawCreateEx asks for the address of a pointer which, if successful in initialising, points to the COM object. But teej supplies it with &lpDD which is the address of not a pointer but of a type LPDIRECTDRAW. Can anyone help me out on this one. I thought i had the pointer to pointer topic covered but it now seems im just as confused as anyone else on pointers.

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!