Thread: IDirectDraw7*?

  1. #1
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879

    IDirectDraw7*?

    Hey everyone, I've been looking at bitmap stuff for DirectX, and for a function that loads a bitmap onto a surface and returns the surface, one of the parameters (arguments?) is an IDirectDraw7*. I was just wondering if there is any reason why it should be a pointer and not a reference? I couldn't really spot anything based on the code there.

    Oh yeah, another thing: In the book I was using before, it used LPDIRECTDRAW's and LPDIRECTDRAWSURFACE's, but in the code I was talking about earlier, it used IDirectDraw7*'s and IDirectDrawSurface7*'s. Is the book using an old version of DirectX, or is the all-caps version just a #define of the same thing?
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    An LPDIRECTDRAWSURFACE7 is just a typedef for an IDirectDrawSurface7*.

    As for passing a pointer instead of a referrence I'd have to see the code in the function you're talking about to say why. In my own bitmap loading code I only pass the main DirectDraw Object (needed to create the surface in the function), the bitmap name and the colorkey (a DWORD) to use for transparency. I create a temporary surface in the function and blit the bitmap onto it. Then I return it.

    **edit** also, consider that you're talking about MS here and that they still have examples in MSDN that use
    Code:
    void main()
    {
    }

  3. #3
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    An LPDIRECTDRAWSURFACE7 is just a typedef for an IDirectDrawSurface7*.
    What about just a LPDIRECTDRAWSURFACE?

    I'll post the code for the function later, I'm not on my computer right now.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  4. #4
    Registered User
    Join Date
    Aug 2001
    Posts
    403
    yes it is an older version, it's still fine to use though. It's also (I think in almost every case) ok to just add the 7 to the end.

    By any chance is the book by Ian Parberry, he has released two books that use the old LPDIRECTDRAWSURFACEs:
    Computer Game Programming with Direct X 7.0
    (and using the same code)
    Computer Game Programming with Direct X 8.0

  5. #5
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Okay, thanks. By the way, what version of DX comes with windows 98?
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  6. #6
    Registered User
    Join Date
    Aug 2001
    Posts
    403
    I believe 98 comes with DirectX 5.. I could be mistaken.

    to check what DX is installed on your system go into
    Control Panel -> DirectX
    in there you'll see settings for DX as well as a version number.

  7. #7
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Heh, that would work but I've already updated directx

    P.S. The CD that came with my geforce2 GTS had DirectX 4 on it... does that mean that my video card is really really outdated?
    Last edited by Hunter2; 11-27-2002 at 05:29 PM.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  8. #8
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Hmm, I have a problem... I changed my IDirectDraw* to a IDirectDraw7*, and I ran into trouble with my CreateDirectDraw(). Apparently, it'll only take a IDirectDraw** (or just 1 pointer? dunno).

    And sadly enough for me, there's no CreateDirectDraw7() (or any variations of it), and my DirectX8 SDK has no docs on directdraw, and neither does my MSVC help (only directx 5 or something), and M$ decided to delete the DirectX7 SDK off its download page, and also deleted the DirectX7 docs off of MSDN. What do I do now?


    **EDIT**
    Never mind Google is my friend.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  9. #9
    Registered User
    Join Date
    Aug 2001
    Posts
    403
    if CreateDirectDraw is a member of a class you are using the old version of that class most likely

Popular pages Recent additions subscribe to a feed