Day 1 complete.

This commit is contained in:
Edward R. Gonzalez 2023-09-08 18:54:16 -04:00
parent 4949c36097
commit 3ace9435bf
6 changed files with 22 additions and 6 deletions

2
.vscode/launch.json vendored
View File

@ -10,7 +10,7 @@
"name" : "Debug handmade win32 msvc", "name" : "Debug handmade win32 msvc",
"program": "${workspaceFolder}/build/handmade_win32.exe", "program": "${workspaceFolder}/build/handmade_win32.exe",
"args": [], "args": [],
"cwd": "${workspaceFolder}/project", "cwd": "${workspaceFolder}/data",
"visualizerFile": "${workspaceFolder}/scripts/handmade.natvis" "visualizerFile": "${workspaceFolder}/scripts/handmade.natvis"
} }
] ]

@ -1 +1 @@
Subproject commit 68369f571a33e32679f3878d266de64bc9ef7f84 Subproject commit 0a6995a2cb6217d01b463bb4416c5d30c075333b

View File

@ -7,5 +7,7 @@ int CALLBACK WinMain(
int nShowCmd int nShowCmd
) )
{ {
MessageBox( 0, L"First message!", L"Handmade Hero", MB_OK | MB_ICONINFORMATION );
return 0; return 0;
} }

View File

@ -3,4 +3,10 @@ Alternative header for windows.h
*/ */
#include "windows/windows_base.h" #include "windows/windows_base.h"
#include "windows/window.h"
#ifdef UNICODE
constexpr auto MessageBox = MessageBoxW;
#else
constexpr auto MessageBox = MessageBoxA;
#endif // !UNICODE

View File

@ -47,6 +47,11 @@ function run-compiler
{ {
param( $compiler, $unit, $compiler_args ) param( $compiler, $unit, $compiler_args )
$compiler_args += @(
($flag_define + 'UNICODE'),
($flag_define + '_UNICODE')
)
write-host "`Compiling $unit" write-host "`Compiling $unit"
write-host "Compiler config:" write-host "Compiler config:"
$compiler_args | ForEach-Object { $compiler_args | ForEach-Object {
@ -330,12 +335,15 @@ if ( $false ) {
#region Handmade Runtime #region Handmade Runtime
$lib_user32 = 'User32.lib'
$unit = Join-Path $path_project 'handmade_win32.cpp' $unit = Join-Path $path_project 'handmade_win32.cpp'
$executable = Join-Path $path_build 'handmade_win32.exe' $executable = Join-Path $path_build 'handmade_win32.exe'
$compiler_args = @() $compiler_args = @()
$linker_args = @( $linker_args = @(
$lib_user32,
$flag_link_win_subsystem_windows $flag_link_win_subsystem_windows
) )

View File

@ -19,13 +19,13 @@ if (-not (Test-Path $path_temp)) {
New-Item -ItemType Directory -Path $path_temp New-Item -ItemType Directory -Path $path_temp
} }
#pragma region gencpp #region gencpp
Invoke-WebRequest -Uri $url -OutFile $destinationZip Invoke-WebRequest -Uri $url -OutFile $destinationZip
Expand-Archive -Path $destinationZip -DestinationPath $path_temp Expand-Archive -Path $destinationZip -DestinationPath $path_temp
Move-Item -Path (Join-Path $path_temp "gen.hpp") -Destination $path_deps -Force Move-Item -Path (Join-Path $path_temp "gen.hpp") -Destination $path_deps -Force
#pragma endregion gencpp #endregion gencpp
#pragma region windows modular headers #region windows modular headers
$repo = 'https://github.com/Leandros/WindowsHModular.git' $repo = 'https://github.com/Leandros/WindowsHModular.git'
Push-Location $path_temp Push-Location $path_temp
@ -37,6 +37,6 @@ if ( -not(test-path $path_deps_windows)) {
Copy-Item -Recurse .\WindowsHModular\include\win32\* $path_deps_windows Copy-Item -Recurse .\WindowsHModular\include\win32\* $path_deps_windows
Remove-Item (Get-ChildItem -Path $path_deps_windows -Exclude '*.h' -Recurse -Force) Remove-Item (Get-ChildItem -Path $path_deps_windows -Exclude '*.h' -Recurse -Force)
Pop-Location Pop-Location
#pragma endregion windows modular headers #endregion windows modular headers
Remove-Item $path_temp -Recurse -Force Remove-Item $path_temp -Recurse -Force