Difference between revisions of "Hardware 3D (C++ DirectX Graphics) Tutorial 2"
(→WinAPI Functions - A vs. W vs. Ex Versions) |
|||
Line 11: | Line 11: | ||
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 <code>CreateWindow</code>, you will see <code>CreateWindow</code>, <code>CreateWindowA</code>, <code>CreateWindowW</code>, <code>CreateWindowEx</code>, <code>CreateWindowExA</code>, and <code>CreateWindowExW</code>. What is with all this bullshit? | 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 <code>CreateWindow</code>, you will see <code>CreateWindow</code>, <code>CreateWindowA</code>, <code>CreateWindowW</code>, <code>CreateWindowEx</code>, <code>CreateWindowExA</code>, and <code>CreateWindowExW</code>. 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. <code>CreateWindow</code>) are actually macros that resolve to either A or W versions depending on a preprocessor setting. So you write code that references <code>CreateWindow</code>, and then selectively target either Unicode or ANSI just by changing a single <code>#define</code>. | + | 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. <code>CreateWindow</code>) are actually macros that resolve to either A or W versions depending on a preprocessor setting. So you can write code that references <code>CreateWindow</code>, and then selectively target either Unicode or ANSI just by changing a single <code>#define</code>. |
The Ex versions are extended versions of pre-existing functions. They generally have all the functionality of the original, plus a little sumpthin-sumpthin. | The Ex versions are extended versions of pre-existing functions. They generally have all the functionality of the original, plus a little sumpthin-sumpthin. |
Revision as of 01:11, 20 December 2018
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 can 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.