Learning code, one bug at a time.

LEARNING TO CODE IN WINDOWS (AND SOME DIRECTX)


A daunting prospect. I aim to demonstrate my own understanding of the subject, and perhaps assist others in overcoming their own obstacles with this sometimes difficult task. The aim is to slowly build a knowledge base solid enough to be able to consistently write programs that perform rendering operations that are all compiled from source code.

The most common platform a user learning to program would be working on is Windows, and given that our programs will be hosted in Windows it’s important we learn enough aspects of it to be able to compile programs reliably. I’ll be using C++ throughout the programs this website concerns and as such if you wish to follow them, you should already be somewhat proficient in the language. Familiarity rather than expertise is all that’s required.

I’ve chosen a basic theme for the presentation of the website and one that fondly reminds me of my computer forays from days long since gone by. Being from one of the first generations ever to grow up on and around computers I always wanted to be able to eventually create content for myself. As the years went by however, computers and software evolved far beyond what I could ever have expected and so now the difficulties one faces when learning are substantial. That is of course if one aims to replicate to some degree modern graphic rendering techniques and standards.

By “modern” of course I mean anything that has been accomplished by game developers in the last 25 years (and possibly even before that). You might wonder to yourself “Why would I concern myself in matching achievements from up to 25 years ago?”. The answer is that the subject material can be so tricky to grasp sometimes, that even so much as successfully rendering a cube on screen, is something to be proud of. That’s a long winded way of saying this subject is hard. Game developers of even that long ago had to accomplish much to be able to render all their desired objects on screen, and even more so when keeping track of their movements, collisions and making the physics feel believable.

Whilst I’m currently studying for a HND in Software Development at a major university, I realised that even that would not be enough to showcase myself or any abilities I had learned. Thus in my own time I’ve been learning C++ and Windows programming. It may seem a rather strange direction to take then, to want to orientate towards rendering graphics and games. For the uninformed, there is in fact a substantial amount of coding challenges in graphics rendering and game development, as well some rather serious maths too. This way I can pursue a lifelong interest and also improve my coding at the same time.

For the most part I will be using Visual Studio to compile programs we’ll discuss on this website. You can learn from any other IDE though, although I recommend using Visual Studio if you decide to follow any of the projects on this website and attempt to run any of their code. A typical view from the Visual Studio screen is seen below.

The first chapter will deal with starting a Windows program from scratch using the Visual Studio template facility, followed by discussions of some of the aspects of Windows the code concerns, all the way through to starting DirectX in a very basic capacity and creating a dialog box to show graphics adapter details.

Chris =H= 8/12/2023