Welcome to a brand new series from PHStudios covering Direct X. For this series, we will be discussing Direct X version 9. Direct X 10 and 11 tutorials will be created at a later date.
This tutorial covers how to create the basic framework for our game by first creating a Win32 Window and message loop. I discuss several things about the Windows API, processing messages, and how our update and draw functionality will be utilized. I also discuss how to get the horizontal and vertical size of our primary display.
In this tutorial, I discuss how to initialize Direct3D and connect it to our window. I also wrap the Direct3D code in a class that we can later modify.
In this tutorial, I discuss how to initialize DirectX Texture and Sprites. We wrap the functionality into a single class, GameSprite. We then draw two separate sprites to the game window.
In this tutorial, I discuss how to clean up the Main.cpp file by creating a Game class that will handle everything game related. The Main.cpp file will just include the WinMain, GenerateWindow, and Windowproc functions (anything related to general Win32 window creation/message handling). The Main.cpp will also include a pointer to our Game object so we can use it when it needs to update and draw.
In this short tutorial, I discuss how to update your game sprites by moving them around the screen.
In this tutorial, I discuss how to create a gameplay object class that we can use in our game. This class will hold our physics, information, and state data.
In this tutorial, I discuss how to create a basic timer that we can use in our game. We will be using Windows API to get the timer values and end up with a elapsed game time in seconds.
In this tutorial, we use the timer we created in the last tutorial to update our sprites. I also discuss the mathematics behind updating sprites with time.
In this tutorial, we use the message queue to get raw input data from the keyboard. This is just one way of many to get keyboard input for your direct x game.
In this tutorial, we use a function that we can call from the Update logic called GetAsyncKeyState. This function will return the status of a key at the time of calling the function. If you use this process, I suggest you call this once per key and at the very beginning of your Update logic.
In this tutorial, we extend on the GetAsyncKeyState tutorial and tie our keyboard input into our game object. This will allow us to move an object around by using our keyboard. I decided to use the arrow keys for this tutorial. Feel free to use different keys.