I kinda figured out how to add an icon to my (Windows) executable by creating a .rc file in the compilation directory with this line in it:
MAINICON ICON "my_icon.ico"
and having my icon there too, and then in build.bat before compiling I call this thing that creates some kind of resource thing (.res file) with the icon:
rc.exe /nologo my_game.rc
and then I compile by passing the resource thing:
cl %CompilerFlags% /Femy_game.exe my_game.res ...
I copied this from some code on GitHub. And with this my exe gets the icon shown as its document icon and on its task-bar icon, but the window I create doesn't get this icon. I see the WNDCLASSW struct you have to make to create a window has a HICON member... So can you make a window and tell it to use the executable's icon? If not, how should I set the window's icon?