2

I'm reading a book about DirectX11 but I'm having trouble understanding some code in the book..

  1. What does HR() function do? Also, what header should I include for it and ReleaseCOM() ?
  2. What are typdefs like typedef float FLOAT in WinAPI ?
  3. Should I really learn things like win32 and COM programming before learning Directx? I really feel lost with all this code..:( .....If so, where are some good tutorials that will give me just what I need for Directx?

Thanks and sorry about such noob questions.

  • 2
    Must be a pretty poor book if it doesn't explain what headers you should use to do the things it's explaining... – Mats Petersson Sep 16 '13 at 14:34
  • @Mats Petersson Introduction to 3D Game Programming with DirectX 11 by Frank Luna. – Icy Keyboard Sep 16 '13 at 14:36
  • My point was that it probably should explain those things - or it says somewhere that "familiarity with Win32 and general programming is expected". – Mats Petersson Sep 16 '13 at 14:38
  • Well it said familiarity with Win32 would help – Icy Keyboard Sep 16 '13 at 14:39
  • Well in defense of the book, It does have a win32 primer at the end of the book..I missed that sorry – Icy Keyboard Sep 16 '13 at 14:49
  • I have an older edition of that book (for DX9). Assuming he hasn't changed much in the newer editions, you probably want to start with Petzold's "Windows Programming" book first. Otherwise you will be looking at the sample code and wondering where these new functions came from and what they do. – Zac Howland Sep 16 '13 at 14:58
  • @ZacHowland yeah the code looks cryptic of course..I was just looking on Amazon for Petzold 's book..looks like I have to learn A LOT of stuff :D but I noticed it's dated '98, is it still valid? – Icy Keyboard Sep 16 '13 at 15:09
  • @IcyKeyboard: Yep. The Win32 API hasn't changed much (especially the beginning stuff). The 6th edition of his book was just released, but I believe it focuses on Windows 8 and is largely in C# now. – Zac Howland Sep 16 '13 at 15:15
  • You want [Programming Windows - 5th Edition](http://www.amazon.com/dp/157231995X/) - there is no 6th Edition. Just make sure you're not getting [Programming Windows: Writing Windows 8 Apps With C# and XAML](http://www.amazon.com/dp/0735671761/) instead. Which is - quite misleading - tagged "6th Edition". It isn't, there is no correlation between these books. – IInspectable Sep 16 '13 at 17:24

1 Answers1

0

I'll skip 1 and 2 and answer 3:

If you are going to do any DirectX programming (directly), you will need a good understanding of the Win32 API and COM. If you don't want to learn those first, then you should download an API that wraps their functionality for you (Allegra, Unreal, etc).

COM is an integral part of DirectX (DirectX is built upon it), so attempting to use DirectX without understanding COM is like trying to drive without understanding what the gas pedal is for.

Zac Howland
  • 15,777
  • 1
  • 26
  • 42