Difference between revisions of "Hardware 3D (C++ DirectX Graphics) Tutorial 3"

From Chilipedia
Jump to: navigation, search
(Created page with "Registering a window class and creating our first window. Popping that MSDN cherry too. == Topics Covered == * Win32 Entry Point Parameters * WinAPI Calling Convention (stdca...")
 
Line 1: Line 1:
Registering a window class and creating our first window. Popping that MSDN cherry too.
+
Windows message pump, window procedure, and event-driven programming in general. Getting messages, dispatching those bad boys, and processing them.
  
 
== Topics Covered ==
 
== Topics Covered ==
* Win32 Entry Point Parameters
+
* Event-Driven programming vs. Game Loop
* WinAPI Calling Convention (stdcall)
+
* Windows Message Processing Flow
* Microsoft Developer Network (MSDN)
+
* GetMessage Pump
* Registering Window Class
+
* WM_CLOSE / PostQuitMessage
* Creating Window Instance
+
* Graceful Message Pump Exit
 
+
== 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 <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 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.
+
  
 
== Video Timestamp Index ==
 
== Video Timestamp Index ==
[https://youtu.be/_sssssssss4 Tutorial 2]
+
[https://youtu.be/_sssssssss4 Tutorial 3]
  
 
== Source Code ==
 
== Source Code ==
Line 22: Line 15:
  
 
== See also ==
 
== See also ==
* [[Hardware 3D (C++ DirectX Graphics) Tutorial 3|Next in series (Tutorial 3)]]
+
* [[Hardware 3D (C++ DirectX Graphics) Tutorial 4|Next in series (Tutorial 4)]]
 
* [[Hardware 3D Series (C++ DirectX Graphics)]]
 
* [[Hardware 3D Series (C++ DirectX Graphics)]]
 
* [https://www.patreon.com/planetchili Planet Chili Patreon]
 
* [https://www.patreon.com/planetchili Planet Chili Patreon]

Revision as of 01:27, 21 December 2018

Windows message pump, window procedure, and event-driven programming in general. Getting messages, dispatching those bad boys, and processing them.

Topics Covered

  • Event-Driven programming vs. Game Loop
  • Windows Message Processing Flow
  • GetMessage Pump
  • WM_CLOSE / PostQuitMessage
  • Graceful Message Pump Exit

Video Timestamp Index

Tutorial 3

Source Code

See also