Managed DirectX 2.0

Welcome to my Managed DirectX tutorials with C#. To run the code, you can either convert the code to use MDX 1.1 or convert the code over to XNA. All tutorials were written using Visual C# Express 2005 and the February 2006 DirectX SDK.

Tutorial 1 – Creating Your First Window

For the start of this tutorial series, you’ll learn how to create a window in C# using Windows Forms. You’ll also learn how to modify this code to make it a bit more efficient.

Tutorial 2 – Setting Up Visual Studio .NET 2005

In this quick tutorial, you’ll learn how to setup Visual Studio .NET 2005 so you can use Managed DirectX.

Tutorial 3 – Initializing Direct3D

This tutorial will show you how to intialize Direct3D with the easiest, but not exactly the most efficient, method.

Tutorial 4 – Improved Direct3D Initialization

In the last tutorial, we initialized Direct3D the quick and dirty way. This time, we’ll query the hardware so you can get greater hardware support, which will speed up performance. We’ll also add fullscreen capabilities.

Tutorial 5 – The C-Unit Framework

In this tutorial, you’ll be introduced to the C-Unit Framework, which will be used to create all future tutorials.

Tutorial 6 – Device Options and Enumeration

In this tutorial, we’ll create a video options dialog, which will allow us to change Device options during runtime.

Tutorial 7 – Rendering Primitives

In this tutorial, you’ll learn how to define and render basic primitives.

Tutorial 8 – Responding to a Lost Device

In this tutorial, you’ll learn about lost devices and how to handle them so your program won’t crash when you minimize or Alt-Tab away from your fullscreen application.

Tutorial 9 – Vertex and Index Buffers

In this tutorial, you’ll learn how to speed up rendering performance through the use of vertex and index buffers.

Tutorial 10 – Transformations

In this tutorial, you’ll learn how to manipulate geometry with the three basic transformations: translate, rotate and scale.

Tutorial 11 – Timing and Frames Per Second

In this tutorial, we’ll create a timing class, which will be crucial in performing all of our animations.>

Tutorial 12 – Texture Mapping

With texture mapping we can make surfaces look more realistic by slapping a picture onto them. This tutorial covers basic texturing methods, which will get you using textures quickly.

Tutorial 13 – Lighting

Add more realism to your games with lighting! In this tutorial, you’ll learn about the lighting system in DirectX and how to incorporate it into your programs.

Tutorial 14 – Dynamic Buffers

Dynamic buffers allow us to change the contents of the buffer each frame. In this tutorial, we’ll learn how to use dynamic buffers to create a basic particle effect.

Tutorial 15 – 2D and 3D Fonts

Displaying text is the easiest way to relay important information to your users. In this tutorial, you’ll learn how to render 2D and 3D fonts using the DirectX Font class.

Tutorial 16 – Bitmap Fonts

DirectX Fonts are easy to use but bitmap fonts are prettier and faster. In this tutorial, you’ll see how to make a bitmap font system with the help of the Angelcode Bitmap Font Generator.

Tutorial 17 – Loading a Static Mesh (.X Format)

Tired of hard-coding all your vertex data? Learn how to load in geometry data from the DirectX .x file format to create complex geometry in a snap! In this tutorial you will learn how to load and display a static mesh.

Tutorial 18 – Terrain Generation with a Heightmap

In this tutorial, you’ll learn how to use a height map to render terrain. Height map terrain generation is a popular and relatively easy way to add nice outdoor scenes to your game.

Tutorial 19 – Moving Around a 3D World

Let’s start moving around the game. In this tutorial, you’ll learn how to perform the calculations that move and rotate a camera.

Tutorial 20 – Detailing a Terrain With Multitexturing

In this tutorial you will learn about multitexturing and texture stages and how you can use them to detail a terrain.

Tutorial 21 – Frustum Culling

Frustum culling is an optimization that will increase the performance of our application by rejecting geometry if it is not within our view frustum.

Tutorial 22 – Sprites and 2D

In this tutorial, you will learn how to work with 2D graphics and animated sprites.

Tutorial 23 – Creating a GUI (Part 1)

In the first tutorial of the GUI series, you’ll learn about the design of a GUI system and the creation of the supporting classes.

Tutorial 24 – Creating a GUI (Part 2)

In the second part of the GUI series, you’ll learn how to implement text labels, panels, buttons, checkboxes, radio buttons, and sliders.

Tutorial 25 – Creating a GUI (Part 3)

In Part 3 of the GUI series, we’ll learn how to create ComboBoxes, ListBoxes, and EditBoxes.

Tutorial 26 – Creating a GUI (Part 4)

In this last part of the GUI series, we will learn how to use the GUI library that we have toiled over in the last 3 tutorials.

Tutorial 27 – Texture Compression, Filters, and Transformations

In this tutorial, you will learn about various texture methods such as compressing, filtering, and transforming a texture.

Tutorial 28 – Offscreen Surfaces and Screenshots

In this tutorial, you’ll learn how to copy images to offscreen surfaces and take screenshots of your applications.

Tutorial 29 – Tetris

Let’s make a game! In this tutorial we’ll make Tetris…except we can’t call it Tetris. So we’ll call it, Four Blocks of Fun.