A Direct3D Tutorial from WitchLord

Started by
18 comments, last by WitchLord 23 years, 11 months ago
Hi all! I have mentioned a few times that I would write a tutorial on Direct3D programming and now I have finally delivered. You can find it here: http://hem.passagen.se/aj76/tutorials.html It is an introductory tutorial divided into two parts, the first part is about how to set up and manage a window with Win32 API. The second is how to initialize Direct3D with the help of Direct3DX and draw a rotating triangle in the window. I want your feedback on this so that I can improve my writing for any future tutorials from me, so it is in your best interest to give me constructive critisism. Also feel free to ask me if there is something you don't understand. You can give me your comments and questions either by e-mail or here in this topic. You'll probably get better response here though as there are others that may help you faster than I. (Hmm, a really stupid mistake to forget to write the word tutorial in the topic, don't you think? I decided to delete the other post and make a new one.) - WitchLord Edited by - WitchLord on 5/20/00 6:18:30 PM

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
Hi Witchlord,

Thanks for your efforts. I really like the layout!

Just a question and a suggestion:

Is this the Direct3D Immediate stuff I''ve been hearing about? I''m learning OpenGL right now... NeHe''s tutorials and the Red Book on the web. I haven''t tried D3D yet.

Could you make a downloadable source code? I would really like to run before I start reading to make sure it will work on my computer.

Thanks again, tremendous effort,

Nick
"If you build it, it will crash."
If you go to the site you''ll find some downloadable source.
----------------
Black Edge Games
----------------
Thank you.

1. Yes, the second tutorial is on Direct3D Immediate Mode. It is for people that have never used Direct3D or Direct3DX before, so you should be able to pick up the basics by reading it.

2. There are already downloadable source code. It is actually two separate programs. If you read the first part there is source code for creating and managing a simple window. In the second part there is source code for creating a window and rendering a rotating triangle in it. Click on the links and you find the source code right at the top of the tutorials.



- WitchLord

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Hi,

Thanks Witchlord this will be great help for people starting out in D3D or people that already know but want "confirmation" on what they are doing =)

I have a question regarding D3DXCreateContext, I think this function does not create a z-buffer, and I think you cannot create a z-buffer after the device has been created (which this function does) so if you need a z-buffer you should use the D3DXCreateContextEx funtion ... is this correct?

Thanks,
Rick
Hi!

This looks pretty good, WitchLord! I think it will be very useful when I start delving into Direct3D.

Just a question, though:
In your Run() functions, don''t you have to call TranslateMessage before DispatchMessage? I thought those two functions were "inseparable".

*Sparkle*
md2ge,

D3DXCreateContext() does create a z-buffer for you, since you cannot set the bit depth of the z-buffer the function uses the maximum available bit depth. But D3DXCreateContextEx() is more powerful and lets you choose the bit depth of the various buffers yourself.

You probably cannot add buffer after the context has been created though, because the context needs to keep track of them all. But then again why would you want to do that?

---

Sparkle,

no the TranslateMessage() call is not necessary. It is there to let you translate WM_KEYDOWN and WM_SYSKEYDOWN to WM_CHAR messages. There are also other translator functions that can be called before DispatchMessage(), for example TranslateAccelerator() that translates WM_KEYDOWN and WM_SYSKEYDOWN into menucommands.

---

As always, don't take my word for it. Even though I'm usually right it doesn't mean that I'm always right. If you find any errors in the tutorials please report them.

If you want any more confirmation from me, you'll have to wait about 8 hours since I'm off to bed now.

I can't wait to see the response I have gotten during my sleep.

- WitchLord

Edited by - WitchLord on May 20, 2000 8:42:30 PM

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Good stuff. Can you make printable versions of your pages tho? White on black isn''t too good on the eyes when you print them.
Buster,

good point. I''ll have to think about it. I just prefer to read tutorials on the screen myself, besides if you print it you cannot use the links to the MSDN library.

---

Hmm, I was expecting a lot more posts during the few hours that I was away. But then again, who would do the posting?You were probably sleeping yourself.

Please continue to give me feedback, the more I get the more motivation I''ll have to write more tutorials.

- WitchLord

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

It''s always good to see D3D tutorials, there''s no where near enough out there on the internet. It''s also refreshing to see a D3D tutorial that isn''t about the D3D Framework.

I read your tutorials, they are well written and are very helpful, I''m waiting for some more. I''ve never used D3DX (I use the Framework). You might just have convinced me to start using it. It looks just as easy as OpenGL to set up. I think I''ll try programming something with it in a minute.

I''m just curious, how far are you planning to take these tutorials? Are you just going to deal with the ins and outs of D3D, or are you going to do some tutorials that people already fairly familiar with D3D will learn from? e.g. BSP''s, particle systems etc.

-- Kazan - Fire Mountain Games --

This topic is closed to new replies.

Advertisement