Help me please!.

Started by
3 comments, last by mrtech 21 years, 11 months ago
I''m learning c - what maths books would you recomend?. And is c good for directx?.
RT
Advertisement
Well, DirectX is C++ COM oriented, but yes you can use C to access all of the functions. Doesn''t really matter, might look a bit uglier, but it does work. I''d recommend to try adopting C++ eventually, though.

"I am governed by none other than the Laws of the Universe."
"I am governed by none other than the Laws of the Universe."
DirectX is a bit hard in C because you have to call a virtual function table eatch time you call a DirectX function.
So in C++:
lpd3dDevice->SetRenderState(...);  
would be fine, but in C, you would need to call it like this:
lpd3dDevice->lpvft->SetRenderState(...);  


... yeh, sux, i know.

[ my engine ][ my game ][ my email ]
SPAM


[edited by - aftermath on May 3, 2002 2:54:32 AM]
Rate me up.
Hello! Congratulations on starting your career as a C programmer!

Be certain to check out the "For Beginners" link above as well as the "Books & Software" and "Articles & Resources" links. You might also want to take a look at the comp.lang.c faq for additional references.

Yes C is good for Direct X - others might say no, use C++ instead, but the two languages are very closely related (C++ is directly derived from C). Once you get the hang of C, you''ll most likely want to move on to C++.

At any rate, here are some samples of using Direct X in C
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Depends on your level of mathiness really

Considering that you mentioned directX, I''m going to assume that you want to do something that has to do with 3D graphics. What you should be aiming for is understanding linear algebra - with emphasis on vectors and transformation matrices. For that, you''ll need basic geometry (from Math 12 or 1st year univ)

Because these are fundamentals, listing specific books is rather hard to do. I suggest going down to your local university bookstore and going through their text-book section for these two topics. Both will easily be in the first year math section. Just look through and hopefully you''ll find one that is easy to understand for you. Perhaps you can try asking friends and relatives that might have some exposure to this to lend you their old text books.

Once you have those fundamentals down, I suggest Numerical Receipes for C. It contains oft-used code that does a variety of topics, like integration, line intersections, etc. It has C-code that you can copy directly, but without understanding the fundamentals, debugging is a pain. I think you understand this hence the request for math books.

Anyway, regarding whether C is good for DirectX, yes it is. I suggest learning at least a tiny bit about C++ though so you can use the Xtended library set (D3DX) that comes with DirectX. It supplies a great many helper functions and interfaces.

Hope that helps and good luck. It might seem daunting at first, but just take it one step at a time. And the cool part is that each of these things you''ll learn now, will provide a good foundation for a lot of other things (directX/C related or not).


TLC

This topic is closed to new replies.

Advertisement