This repo is a collection of examples of how to run graphics programs in Direct3D. Having learned how do this for OpenGL on my LearnOpenGL-Odin repo, I thought it would be a interesting challenge to attempt Direct3D in Odin.
The learning path format on the Learn OpenGl site is what I will be using to learn Direct3D.
If you are interested in following along:
- You will need to install Odin. The Getting Started guide has different options you can follow.
- If you have Odin already, I suggest that you update it. I will be using the most recent build of odin as of the time I uploaded this repo onto github.
- You will need a text editor or IDE. This project was a put together in VS Code (and on Win11)
- That's it. Odin ships with the libraries needed to follow along with the tutorials on learnopengl.com. Plus the additional assets required are contained in the project.
- Many of the resources online on how to create apps with direct3d are written in C++. Odin is not an object-oriented language while C++ is. That is not an issue as there are ways to get around not using OOP and still achieving the same results.
- I am a hobbyist graphics programmer and low-level programmer as well. I'm still learning. The code may not be as elegant in some places, but my priority is to make apps work with no bugs and no memory leaks.
- Where possible, I will leave notes/comments to describe what is happening specifically as it relates to the direct3d API.
- For window and input management
Simple DirectMedia Layer or SDL(specifically SDL2) will be used. It is important to know that the project requires theSDL2.dllto be present in the same folder as the executable for your apps to run.
This is not one large Odin project, instead it is a collection of smaller Odin projects grouped by chapters. To run each project, you will need to enter each folder and run the project from there. Simply run odin run . and you will be good to go.
cd 1-4-a-hello-triangle/
odin run .
- Bugs in my code could cause you to get stuck. If you catch a bug, please submit an issue
- Having the Direct3D website open is important.
- Since we are going to follow learnopengl, I highly recommend visiting Learn OpenGL for reference. There are also technical explanations on how certain graphics features work that aren't that far different from Direct3D.
- If you need assistance with Odin, I highly recommend joining two Discord servers
- If you are new to Odin and are interested in learning it, I recommend checking the Odin website. You can also follow Ginger Bill (Creator of Odin) on Youtube. You can also checkout Karl's Youtube Channel and I recommend buying his book Odin Book.
- It goes without saying but using web search and A.I. tools can help. Just be mindful that A.I. is not always going to be 100% reliable and you may need spend time cross checking and asking more seasoned developers to verify the outputs you get from it.
- Chapter 1 - Getting Started
- Chapter 2 - Lighting
- Chapter 3 - Model Loading
- Chapter 4 - Advanced OpenGL
- Chapter 5 - Advanced Lighting
- Chapter 6 - PBR
- Chapter 7 - Debugging
- Chapter 8 - Text Rendering
- Chapter 9 - 2D Game