-
Welcome
· 2 minute readIntroduction
Greetings!
Welcome to my blog. My name is Brian and I am a professional software developer. I am currently learning Python, re-learning C and revisiting web-development (to make this website/blog).
I will be posting mostly about programming stuff that I’m either currently learning or have learned over the years hoping that it may help others. I welcome feedback and suggestions, both of the content and of the website.
-
Installing MSYS2 - Overview
· 4 minute readOverview of Installation
In order to get MinGW 64-Bit installed, I will first need to download and install MSYS2. This provides a package manager
pacman
, which is a port from Arch Linux.If you would like a more in-depth guide for the installation process, please view my full guide .
Downloading and Installing MSYS2
I recommend having a Windows Command Prompt open (or your preferred Windows Console Emulator) to assist in the installation process for there are some things you cannot do from within MSYS2 Shell.
Downloaded the 64-Bit Installer Binaries
- I chose
msys2-x86_64-20161025.exe
.
Note: From this version of MSYS2, it cannot be installed on FAT* partitions, and cannot be installed on Windows XP.- I chose
Installed using the Installation Wizard.
- Installation folder:
C:\Apps\msys64
- Left default Start Menu Shortcut.
See full guide for a step-by-step walkthrough of the installation wizard.- Installation folder:
-
Installing MSYS2 - Full
· 16 minute readOverview of Installation
I will be downloading and installing MinGW 64-Bit.
The recommended way of installation is through MSYS2 and it’s package management system Pacman.
This is a full example of setting up MSYS2. If you would prefer a more succinct guide, please check out my overview.
Installing MSYS2
What is MinGW?
MinGW stands for Minimalist GNU for Windows. MinGW-w64 is a fork from the original MinGW project. From MinGW’s own description, it should be noted that “MinGW, being minimalist, does not, and never will attempt to provide a POSIX runtime environment for POSIX application deployment on MS-Windows.”
What is MSYS2?
From their webpage, MSYS2 is a software distribution and building platform for Windows.
At its core is an independent rewrite of MSYS, based on modern Cygwin (POSIX compatibility layer) and MinGW-w64 with the aim of better interoperability with native Windows software. It provides a bash shell, Autotools, revision control systems and the like for building native Windows applications using the MinGW-w64 toolchains.
-
Choosing A License
· 5 minute read · 4 CommentsHow to choose a license for your open source project?
Let’s talk licenses.
I figured this was a fitting first real post due to it has been something I have been struggling with lately. I am new to having public code. This is partly due to the companies I’ve worked for do not allow external work; but, admittedly, it has mostly been on me for just not working on stuff that I could release.
choosealicense.com
Github has a page that has fittingly a domain named choosealicense.com.
I prefer looking at the appendix for it gives a nice chart of all the licenses that it has on file.
Now to choose a license.
-
Contact
· 1 minute readYou may reach me by email brian-blog@[This domain].
Or you can find me on irc on the Handmade.Network’s irc. I can usually be found in #random.
-
About
· 1 minute readGreetings!
My name is Brian and welcome to my blog.
I am a professional software developer and have worked in the Games industry for 10 years.
-
030
· 60 minute readnotes for handmade_hero_day_030
2014-12-26 @ 10:03
Assume the points are as if Casey is describing what to do. I will explicitly add
TODO(bk)
orBrian:
with a note that I have for the reader.In the explanation,
variables
,parameters
andmembers
will be highlighted. Likewise, functions, structs and constants will be bolded.The following are marks that I use to help write the code. They are not to be added to the file and are simply me giving some sort of instructions in the code.
All code blocks start as follows:
Edit GameUpdateAndRender in
handmade.cpp
:Where the first value
Edit
describes that you are making a change. Other actions would beView
,Add
,Rename
orRemove
.GameUpdateAndRender will refer to either the struct or function that we are changing. When this is not included, it means we are simply changing the file itself.
The file being referenced (eg
handmade.cpp
) will always be included.// act:
Action of which to take// pos:
Position of where within the struct or function to put the code.// rem:
Remark about something of this code, but not something Casey notes.Please note, sometimes in code when renaming/refactoring I will show all the lines that will change. It is not expected that you will write every line each time. A simple find/replace will suffice. I only include to be thorough.
Video Notes
Welcome to Handmade Hero everyone. This is of course a show where we make an entire game from scratch, using nothing but our bare hands. No libraries. No engine. And we are basically doing this because I really think there is something valuable to everyone who’s a serious game programmer going through the entire pipeline of a game from start to finish. Just so that they can see every last little thing that goes on in a full stack of a game.
I think it’s great for educational purposes. I think it makes you more powerful for when you do professional programming. I think it allows you to be the kind of programmer who works on an engine team. It allows you to be someone who can overcome limitations of the tools that they work with. It’s just very empowering to know how everything works, and that is exactly what we are doing. We are taking it slow and investigating every last little aspect of game programming as it comes up.
We are at the point where we have made our Win 32 prototyping layer, and we are building our game on top of it right now.
What we are doing this week is trying to imagine roughly the sorts of things our game is going to have to do so that we can start building our engine. And one of the things that I’ve said early on is in order to build a game engine you need a game and in order to build a game, you need a game engine.
Because if you’ve never built a game before, you won’t know what to put into your game engine. You won’t know how to structure or architect it correctly so that it’s not just a pain in the butt to use. And similarly, if you don’t have a game engine, you can’t really make a game.
We are in a chicken and egg scenario when we are making everything from scratch and so what you want to do is you want to use what I like to call exploration programming. You want to start to play around with making the game and the engine together, and you just want to play around with test code so that you could start to see what things should look like. And once you kind of get a sense of what a certain part looks like, then you can start to go and make the basis of the game engine.
And so that is what we are doing today. We are continuing with our exploration and just trying to get stuff on the screen and make stuff work. We are not caring about code quality. We are not caring about cleanliness or any other abstract concepts. We are just talking about let’s just write some code that does some “gamey” stuff and lets see what it looks like, so that we can start to pull the common pieces out of it and pull the structure out of it that we are going to need in order to make a game engine.
-
004
· 16 minute readHandmade Hero Day 004
NOTE(bk): The notes will be changed. At the moment they are my opinion or interpretation of what Casey says during the video. I will change so that it will be from what he describes in the video, with me making the rare aside note.
StretchDIBits vs BitBlt
Casey: Chris Hecker messaged him about this, for he says that he was having troubles remembering on stream yesterday. He normally does not use StretchDIBits.
BitBlt does not take a pointer to the bits. It has to go device context to device context. Which means you have a DC that you leave around that has the bitmap in it, and you always do the BitBlt from that DC to the Screen/Window DC, that you are actually drawing to. Which is why Casey did all the stuff like CreateCompatibleDC.
So why did Casey always use BitBlt? StretchDIBits used to be the slow path, it was slower than BitBlit since Windows™ could do the allocation of the memory and had the bitmap already selected it was a faster path then going through StretchDIBits.
Since this is supposed to be for us to write a renderer and that performance difference may not even exist anymore, there’s probably no reason to ever use BitBlt. StretchDIBits should probably be fine for us for eventually when we optimize things we will want to create an OpenGL context and actually write directly to a texture.
-
003
· 15 minute readHandmade Hero Day 003
NOTE(bk): They notes will be changed. At the moment they are my opinion or interpretation of what Casey says during the video. I will change so that it will be from what he describes in the video, with me making the rare aside note.
Recap of 002
Something to keep in mind is the reason we need the callback function (Win32MainWindowCallback) is because windows reserves the right to call us back at any time.
In our main message loop, after we get a message that is > 0, we first translate the message (TranslateMessage), then we dispatch it (DispathMessageA).
-
001 Q&A
· 4 minute readvideo 001 - Handmade Hero Day 001 Q & A
IMPORTANT(bk): All of the answers are my interpretation of what Casey responded. I will change them to what he actually replies later.
Q: Can you show how you added handmade hero to the path?
Answer: Within misc\shell.bat added
SET PATH=W:\handmade\misc;%PATH%
Q: Do all C/C++ use WinMain? Does the Witness use it?
Answer: Everything starts at WinMain.
Q: Using
user32.lib
what is the difference between Microsoft’s compiler and GCCAnswer: He does not know since he does not compile with GCC on windows. He suspects that GCC has a different import library scheme.