Archived

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

How did you guys start with DirectX?

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

I am a current Allegro programmer but I''ve come to the conclusion that it''s basically for beginners. I was thinking of moving on to WinAllegro for compatibility but I figured that it would be delaying the inevitable. I need DirectX. Problem is that even though I have bought what seems to be a great book and scoured the net many times for helpful articles I have had no luck understanding DirectX. I keep stopping with things like COM and API and other terms that seem to just get in the way. I do want to learn DirectX and I am aware that there are even libaries which aim at making it easier to use but I keep ending up frustrated no matter where I look. How did you guys even start? I know C. I''m starting to understand C++. What am I missing? Are there places out there that help beginners instead of handing you dozens of lines of unexplained code? Or is it something that you either know or don''t?

Share this post


Link to post
Share on other sites
Well it does help to learn the basics (and advanced topics!) of object oriented programming, simply because (I personally find, anyways) programs are easier to conceptualize.

The book I recommend over and over is Object Oriented Programming in C++, by Waite Group Press. It''s got a lot of topics for OOP, and it''s a college-level book, so should be a good exercise for anyone below that level, or a refresher for anyone above it.

As for DirectX, I started with Windows Game Programming for Dummies, by André Lamothe. He doesn''t seem to have the best coding style (I''m a strong advocate of Hungarian notation; can''t stand reading int damned_lowercase_and_underscores code, but that''s just me. Tips of the Windows Game Programming Gurus should be a good beginner book too (same author, same coding style).

I would recommend, however, that you stick with DirectX 7 (or lower) until you''ve built some skill with DirectDraw, because learning DirectX 8 graphics is a pain in the @$$ if you also must learn a little of renderstates and how vertex formats work.

Start small, work your way up!



MatrixCubed
http://MatrixCubed.org






Share this post


Link to post
Share on other sites
Pick up "Tricks of the Windows Game Programming Gurus" by Andre Lamothe.

The way I got started was by experimenting with Andre Lamothe''s code. There was a simple demo that plotted random pixels all over the screen, so I started modifying it, getting it to draw squares, or fill the screen, experimenting with how colours worked in DirectDraw, that sort of thing.

After that I went through all the tutorials in the DirectX SDK. Plus I printed out the SDK documentation and read most of it.

DirectX would probably make a lot more sense if you already knew Win32 as well. And don''t worry about COM, most likely you won''t even know you''re using it.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I started with windows game programming for dummies (Andre Lamothe). BTW you have a good tutorial on gamedev called Game
Programming Genesis that introduces you to DirectX.
Good Luck.
Red.

Share this post


Link to post
Share on other sites
There is absolutely no shame in using Allegro, if it gets the job done and doesn''t slow things down. WinAllegro wraps DirectDraw and--if I''m not mistaken--presents the same interface as the other ports of Allegro. This means that you won''t be tied to Windows. Plus, Allegro is a bit easier to work with than DirectDraw and contains lots of helpful little functions.

If you''re still set on moving to DirectDraw, I tend to agree that you should try learning some Win32 programming first. Once you''ve got that, though, I''d say that you''d probably be able to manage just fine with the SDK. Books are so expensive these days...

Share this post


Link to post
Share on other sites
I''m start with "Windows Game Programming for Dummies", then "Teach Yourself DirectX7 in 24 hours".
IMHO, the 1st book is a MUST have for DirectX beginners !! It has a DOS-like DX wrapper inside & just help u start coding DX !! I also got "Tricks of the Windows Game Programming Gurus" too, excellent !!! (Andre Lamothe is cool !)

Share this post


Link to post
Share on other sites
I started with just SDK and many helpful articles and tutorials around the net, it took alot of many long nights to get a basic understanding, but it was well worth it. I am still learning alot, and still need too. I suggest just messing around with the demos that come with the SDK and see what you can do with it. But hey, everyone learns diferently so what ever you think is easier for you, goodluck, later-


what we do in life... echoes in eternity...

Share this post


Link to post
Share on other sites
Thank you for everyones'' opinions and suggestions. The consensus seems to involve the book I mentioned above but didn''t name on purpose before: "Tricks of the Windows Game Programming Gurus." It is a great book and I love the author''s style but apperantly I need to put more time in with it.

simon_brown75, you brought to my attention something that I used to do before but don''t do now for some reason: copying and modifying code. That''s exactly how I learned BASIC and then C! I will try the same with code from Mr. LaMothe''s book/CD as well as some good tutorials I find. It doesn''t help me to just look at the code and brief comments and try to figure it all out.

A few other books were mentioned which I am interested in but can not afford right now.

Thanks again for the help. I''ll make that darn RPG one day... but until then it''s Pong and PacMan for me.

Share this post


Link to post
Share on other sites
I went to Andre Lamothes web page www.xgames3d.com, and downloaded the introduction to directx. It had source code to move a pixel around the screen. With this I started writing a little tron game.

Very small to begin with.

T

Share this post


Link to post
Share on other sites
I got started with Lamothe too. He must feel pretty great knowing that he teaches just about everyone how to get started with game programming!! wow!

SavageGimp

TrueKnight42 on AIM

Share this post


Link to post
Share on other sites
Last summer I started programming with DJGPP + Allegro, I made a platform game demo, and resived a mail if I wanted to make a commercial game. I got VC+6.0 + DirectX in Fall and learnt DirectX, re-created the game to use it and sold it as a promotion game a few days before christmas. Now I know VC+6.0 + DirectX programming very well and like it. Havn''t started with D3D yet, I know the basics of OpenGL tough.

/MindWipe

"If it doesn''t fit, force it; if it breaks, it needed replacement anyway."

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I found that simply tinkering with the samples in the SDK were the best way to learn DirectX, However, for an early age I had already had an underlying understanding of assembly language and C++ before that so maybe it isn''t as easy as it seems. Since you already know C, it should be pretty easy to trace each line of the program in a sample and get the basic understanding of what it is doing, this will help you to figure out how windows COM works as well.

Share this post


Link to post
Share on other sites
I found that simply tinkering with the samples in the SDK were the best way to learn DirectX, However, for an early age I had already had an underlying understanding of assembly language and C++ before that so maybe it isn''t as easy as it seems. Since you already know C, it should be pretty easy to trace each line of the program in a sample and get the basic understanding of what it is doing, this will help you to figure out how windows COM works as well.

Share this post


Link to post
Share on other sites
probably you''re right but I haven''t SDK.......and I don''t have any money for books....can anyone help me (with tutorials)?
or simple examples in Dx?

Share this post


Link to post
Share on other sites
Well, if you haven''t got the SDK you''re not going to be able to compile anything anyway, since it contains all the libraries and header files you need.

There''s a C++ specific download of the SDK which I think is about 45 MB, or you can order it on CD from Microsoft for about $10 (US).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The 45 MB download is with examples and the available documentation.

Share this post


Link to post
Share on other sites