Jump to content
  • Advertisement
Sign in to follow this  

Getting started

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

Hi! I wonder what my first directX - program will be, a basic fullscreen program or something. Can you write a code for it. Thanks Albert

Share this post

Link to post
Share on other sites
If you are interested, my site recently has some DirectX tutorials (C#) at http://magclan.cwhnetworks.com/MAGSoft2 - check the first 3 "Latest Articles" as they go from basics of setting up to rendering a 3D triangle.

More will be coming VERY soon

Share this post

Link to post
Share on other sites
Thanks alot!
3d things are a bit to hard to me, can you write a code that is "your first directX - program" or something?

Thanks alot!

Share this post

Link to post
Share on other sites
This is a post I made earlier this year covering the most general methods to starting on the road to graphics development.

This is from a post I made earlier this year on Gamedev.net and should be a nice learning path to follow for anyone starting out with any API.

The Language
Choose a language that best suites you and a decent compiler. Most game/graphics developers choose c++ and DirectX/OpenGL. This is obviously very flexible and a variety of languages are available for the use in DirectX such as C#/VB6/VB.NET, etc...

I would say the learning DirectX really is very simple and even simpler if you are using the managed directx api. It's clean and straight to the point.

DirectX also has a good background and through a number of revisions it's become a very concise/clear/readable API. The Documentation is also very well layed out and samples/starter guides are included

The Learning Phase
I would like to add that learning an API is a good start but getting a good grip on graphics theory and mathematics related to 3d programming is essential. The world of graphics programming is moving to shaders and a fundamental base of matrices and vectors are very important when working with shaders since you'll be transforming vertices to spaces and back and working with objects in different spaces.

You can then set some projects for yourself. Don't aim too high but get something to render and play with the possiblities of what you can do.

Step 1
Get a window up and running and initialize Direct3D.
This will help you get some good understanding on what the device is and how it's used. You will pass your window's handle to the creation function. So it links the window with the device. You will also understand how windows messages are handled and a good grounding on render loops

Learning Objectives.
- Window messages
- Render Loops
- Direct3D Device

Step 2
Render a colored triangle
Through this you will learn about vertex formats and what they are. How they are used and how they are setup. You will also learn about winding orders such as clockwise/counter clockwise and how they are culled. Which just means that they don't get rendered if you have a clockwise winding order and you specify to cull clockwise created primitives.

You will also learn about vertex streams and vertex buffers.
Vertex buffer being a direct3d enhanced buffer that stores your vertices.

Also you will come in contact with some primitive types and how they are formed such as TriangleStrips, TriangleLists, PointLists, LineLists.

You will also learn how vertices are transformed through matrices and that every primitive might have it's own matrix that places it in the world.

Transformations also needed to be taken into consideration here or you may decide to skip it for future learning.

Learning Objectives.
- Vertex Formats
- Transformation Matrices
- Coloring
- Primitive Types

Step 3
Render a textured Quad
Coming to textured primitives, you will learn what texture coordinates are and how to load resources from a disk. This will further enhance your understanding of vertex formats and how Direct3D helps you place a texture unto a primitive.

Also you will further learn how primitives are stiched together to form larger primitives as you will have rendered 2 primitives to form a quad.

Step 4
Render a lit and textured Quad
Moving to light you will learn how different lights interact with different objects through normals and materials.
Normals being the key point in this step. Lights give the scene a more realistic feel by adding more depth to your objects. You will learn about materials and how lights interact with different materials.

Learning Objectives.
- Lights
- Materials
- Normals

Step 5
Translating (moving)/ Rotating objects
Moving objects in a scene is a very important aspect to getting a game up and running since you want objects to move. Matrices form a big part of this. You will learn about different spaces such as object/world/view/projection space.

You might also add some additional learning to this section with regards to frame rate independent movement. This will be important when programming your games for different spec machines.

Learning Objectives.
- Matrices
- Spaces
- Timers

Step 6
You will learn about meshes and if you really think about it, it's hardly ever that you will have to hardcode primitives, you want detailed meshes that were created in a modelling package don't you? You will further learn about how to load resources from disk and what is contained in these files.

Learning Objectives.
- Meshes
- Resource loading (further advancement)

Step 7
Special effects
You might want to start experimenting with Alpha blending to get transparency and so forth. If you have a good fundamental knowledge of the previous steps the world is your oyster. You will just improve as you carry on. You will also learn how the graphics pipeline works and how vertices/primitives are fed into the pipeline and colors are computed etc..

You might want to start looking into alpha blending as I have mentioned and then move unto some more advanced topics.

Learning Objectives.
- Alpha Blending (vertex, material, texture, frame buffer, render target)
- Graphics pipeline (further advancement)

Step 8
More and more learning (shaders)
Get a good grip with the Fixed Function pipeline, The fixed function pipeline is what you've been working with up until now. If you feel you are upto it you can move on to shaders or.. you could start coding your very own game. It may seem boring in the beginning but this is where you have to decide if you want to move on right now or code some games.

Start off simple like tetris, break out, pong.

Learning Objectives.
- Shaders or Game engine development

This might seem a little confusing at first. I hope not but I missed out alot of aspects and it's just a simple guide. Use the DirectX SDK docs, they are very helpful. When it comes to game engine development. GDNET is a perfect place to start with articles written by very popular people who have been developing for years.

For some more more information check out the Forum FAQ and my site for C# and Managed DirectX Tutorials

I hope this helps.
Take care.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!