DirectX tutorials

This is a discussion on DirectX tutorials within the Game Programming forums, part of the General Programming Boards category; I am looking for a directX tutorial that uses C. I have searched online using google and can only find ...

  1. #1
    Registered User sean345's Avatar
    Join Date
    Mar 2002
    Posts
    346

    DirectX tutorials

    I am looking for a directX tutorial that uses C. I have searched online using google and can only find C++ tutorials and not C. Does anyone have any links to such tutorials.

    Thanks.

    - Sean
    If cities were built like software is built, the first woodpecker to come along would level civilization.
    Black Frog Studios

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    DirectX is OO and COM based. If you want to use it, I recommend using a C++ compiler at least. Trying to write DX code in C can be a pain as you have to dereference the virtual pointer table yourself.

    Stick to C++ if you can (IMHO).

    The only information i've seen on this is in a book that i bought (i can't remember which one might have been Andre's "Tricks of The Windows Game Programming Gurus" but i'm not sure.

    good luck!
    U.
    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    cant u do non OO stuff with DX

  4. #4
    Registered User Coder's Avatar
    Join Date
    Aug 2001
    Location
    Cairo, Egypt
    Posts
    128
    Originally posted by pode
    cant u do non OO stuff with DX
    DirectX uses COM interfaces ( similar to C++ classes ), that means whatever you want to do with DirectX you do it through calling a method of the object you created.

    C programmers have to use a function pointer form a function table in order to call methods, which is a bad way to do things.

    Microsoft provides a solution - which is also bad by the way - using macros :

    If in C++ you call the method IDirect3D::CreateDevice( parameters go here ), then in C you'd call the macro IDirect3D_CreateDevice( Pointer to an IDirect3D object, parameters go here )

    As you can see, an additional pointer is needed when calling the macro, as the macro uses the function table in that object to do the call.

    How did you stumble in a C only compiler anyway? Borland's C++ 5.5 is free, although it's a little painful to work without the IDE.
    Muhammad Haggag

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. The best DirectX tutorials
    By Overlord in forum C++ Programming
    Replies: 13
    Last Post: 09-24-2006, 04:14 AM
  2. DirectX 9 Tutorials (C# only)
    By Grayson_Peddie in forum Game Programming
    Replies: 1
    Last Post: 04-20-2003, 04:45 PM
  3. DirectX Tutorials
    By Glirk Dient in forum C++ Programming
    Replies: 2
    Last Post: 01-28-2003, 07:36 PM
  4. Looking for DirectX Tutorials that uses VC++
    By Grayson_Peddie in forum Game Programming
    Replies: 4
    Last Post: 09-08-2002, 09:16 PM
  5. DirectX 8.1 SDK Tutorials And Stuff
    By c++_n00b in forum Game Programming
    Replies: 3
    Last Post: 04-06-2002, 09:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21