Direct2D Tutorial 2: Showing a Window @WhatsACreel
Direct2D Tutorial 2: Showing a Window  @WhatsACreel
Uploaded June 2014 | Updated September 2026, 2 weeks ago
In this video we'll look at creating and displaying a main application window. We can't start drawing with DirectX until we've got a window to draw on.

Creating a window is a multistage procedure. We need to register a class for our window, which lets Windows (the OS) know some information about the window, including what function we'll use to process events.

Then we can create our window using the CreateWindow or CreateWindowEX function. Once our window is created we can show it. In the vid I talk about CreateWindowEx, but accidentally call CreateWindow. You want the EX version, I'll fix it next tute.

After our window is shown, we need to start a message loop, which looks for messages from various events occurring with our window. The message loop repeatedly checks if any interactions happen to our window until our window is closed. When we get a message we pass the messages to an event handling procedure we wrote before hand.

It's pretty long winded, but it's not difficult code. One way to do this, is to follow the function and structure pages listed on MSDN. After all, this is Microsoft programming so one of the best resources is the official Microsoft specifications.

There's many resources available which outline what I'm doing in this tute. If you want another explanation, I'd recommend you visit one or both of the following DirectX tutorial websites:
directxtutorial.com
rastertek.com
Direct2D Tutorial 2: Showing a WindowIs this New Quadratic Formula Actually Faster than the OG Quadratic Formula? (For a Computer)Studying Agner Fog: Intro and Static Local ArraysModern x64 Assembly 6: ADD, SUB INC and DECx64 Assembly and C++ Tutorial 0: Setting Up x64 Assembly in Visual Studio Expressx64 Assembly Tutorial 50: SSE Conversion InstructionsCollatz Conjecture, Racing the Dragon (LLVM, Assembly Language, C++, BitHacking)C++ Tutorial 16: Classes and ObjectsNewtons Method: How to Compute Pretty much AnythingC++ Tutorial 2: Comments, Datatypes and Variablesx64 Assembly and C++ Tutorial 65: HBlur in SSE CodingTop 20 Most Important Machine Instructions (Assembly Language)
Creel |

Direct2D Tutorial 2: Showing a Window

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER