Hardware 3D (C++ DirectX Graphics) Tutorial 2
Registering a window class and creating our first window. Popping that MSDN cherry too.
Contents
Topics Covered
- Win32 Entry Point Parameters
- WinAPI Calling Convention (stdcall)
- Microsoft Developer Network (MSDN)
- Registering Window Class
- Creating Window Instance
WinAPI Functions - A vs. W vs. Ex Versions
When you type your WinAPI code, you're gonna find many versions of the same function pop up in your Intellisense bullshits. For example, if you type CreateWindow
, you will see CreateWindow
, CreateWindowA
, CreateWindowW
, CreateWindowEx
, CreateWindowExA
, and CreateWindowExW
. What is with all this bullshit?
Well first of all, for most WinAPI functions there are two versions: a multibyte (ANSI) version, and a Unicode (Wide) version. That explains the A/W shit. And the functions that don't end in A/W (e.g. CreateWindow
) are actually macros that resolve to either A or W versions depending on a preprocessor setting. So you write code that references CreateWindow
, and then selectively target either Unicode or ANSI just by changing a single #define
.
The Ex versions are extended versions of pre-existing functions. They generally have all the functionality of the original, plus a little sumpthin-sumpthin.
Video Timestamp Index
Source Code
See also
This video talks about the course syllabus for the Hardware 3D tutorial series (the shit we gonna learn) and the prerequisites for following this series (what you need to know, and what you need to have). Use it to get an idea of what this series is about, and whether you have what it takes to follow along. If you don't know this shit, it's okay to just come along for the ride if you interested; you'll learn something at least. But if you decide you wanna dig deep and master the material, check out the links below for my C++ series and the 3D Fundamentals series.
Topics Covered
- Direct3D 11 vs. D3D12 / Vulkan
- Course Syllabus (Topics Covered)
- Prerequisites / Requirements
- Planet Chili Community
Basic Plan for Hardware 3D
We're gonna start low level, and work our way up quickly to the good shit. This first arc of Intermediate is gonna be 100% console app land. First comes a little lecture on memory, variables, and the binary number system. Then we cover pointers, c-strings and console I/O, basic file I/O, and heap allocation. This is where we ascend to a higher plane of thought. We will migrate from c-strings and basic I/O to awesome std::string
and std streams. While we're on the topic of containers, let's get a taste of std::vector
. Then, we'll wrap up the console app section with a fun little word game, putting together everything learned so far in Intermediate.
After the console section, the plan is to learn how to load an image from a bitmap file, and then to cover basic sprite drawing operations, so we can abandon the nasty PutPixel
calls once and for all. After this we'll cover more standard library containers, iterators, and algorithms. We're gonna learn OOP concepts like inheritance and polymorphism. We're gonna learn sweet C++11 stuff like lambda functions and move semantics. And we're gonna make more games.