diff --git a/.gitignore b/.gitignore
index dfc1af8..b4ebcb3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,4 +17,5 @@ bld/
[Ll]og/
[Ll]ogs/
vc140.pdb
-project/build
+
+build
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
new file mode 100644
index 0000000..f4f13cf
--- /dev/null
+++ b/.vscode/c_cpp_properties.json
@@ -0,0 +1,35 @@
+{
+ "configurations": [
+ {
+ "name": "Win32 msvc",
+ "includePath": [
+ "${workspaceFolder}/project/**"
+ ],
+ "defines": [
+ "_DEBUG",
+ "UNICODE",
+ "_UNICODE",
+ "GEN_TIME",
+ ],
+ "windowsSdkVersion": "10.0.22621.0",
+ "compilerPath": "cl.exe",
+ "intelliSenseMode": "msvc-x64",
+ },
+ {
+ "name": "Win32 clang",
+ "includePath": [
+ "${workspaceFolder}/project/**"
+ ],
+ "defines": [
+ "_DEBUG",
+ "UNICODE",
+ "_UNICODE",
+ "GEN_TIME",
+ ],
+ "windowsSdkVersion": "10.0.22621.0",
+ "compilerPath": "clang.exe",
+ "intelliSenseMode": "clang-x64",
+ }
+ ],
+ "version": 4
+}
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..38fe1d4
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,17 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "type":"cppvsdbg",
+ "request": "launch",
+ "name" : "Debug handmade win32 msvc",
+ "program": "${workspaceFolder}/build/handmade_win32.exe",
+ "args": [],
+ "cwd": "${workspaceFolder}/project",
+ "visualizerFile": "${workspaceFolder}/scripts/handmade.natvis"
+ }
+ ]
+}
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..1f26b18
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,41 @@
+{
+ "files.associations": {
+ "*.rmd": "markdown",
+ "array": "cpp",
+ "compare": "cpp",
+ "type_traits": "cpp",
+ "utility": "cpp",
+ "xtr1common": "cpp",
+ "xutility": "cpp",
+ "initializer_list": "cpp",
+ "table.h": "c",
+ "iterator": "cpp",
+ "memory": "cpp",
+ "exception": "cpp",
+ "optional": "cpp",
+ "tuple": "cpp",
+ "xmemory": "cpp",
+ "algorithm": "cpp",
+ "limits": "cpp",
+ "concepts": "cpp",
+ "*.rh": "cpp",
+ "chrono": "cpp",
+ "string": "cpp",
+ "filesystem": "cpp",
+ "format": "cpp",
+ "ratio": "cpp",
+ "xstring": "cpp",
+ "functional": "cpp",
+ "vector": "cpp",
+ "list": "cpp",
+ "xhash": "cpp"
+ },
+ "C_Cpp.intelliSenseEngineFallback": "disabled",
+ "C_Cpp.errorSquiggles": "disabled", // This doesn't work well with how the headers are included.
+ "C_Cpp.default.compilerPath": "cl.exe",
+ "C_Cpp.exclusionPolicy": "checkFilesAndFolders",
+ "C_Cpp.files.exclude": {
+ "**/.vscode": true,
+ "**/.vs": true,
+ }
+}
diff --git a/HandmadeHero.10x b/HandmadeHero.10x
new file mode 100644
index 0000000..610cfe0
--- /dev/null
+++ b/HandmadeHero.10x
@@ -0,0 +1,60 @@
+
+
+
+ *.*,
+ *.obj,*.lib,*.pch,*.dll,*.pdb,.vs,Debug,Release,x64,obj,*.user,Intermediate,
+ true
+ true
+ true
+ false
+ false
+ pwsh $(WorkspaceDirectory)/scripts/build.ps1 msvc
+ pwsh $(WorkspaceDirectory)/scripts/clean; $(WorkspaceDirectory)scripts/build msvc
+
+ pwsh $(WorkspaceDirectory)/scripts/clean.ps1
+
+
+ $(WorkspaceDirectory)/projects/build/handmade_win32.exe
+ $(WorkspaceDirectory)/projects
+ $(WorkspaceDirectory)/projects/build/handmade_win32.exe
+ $(WorkspaceDirectory)/projects/build/handmade_win32.exe
+
+ false
+
+ Debug
+ Release
+
+
+ x64
+
+
+ C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include
+ C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\VS\include
+ C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt
+ C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um
+ C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared
+ C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt
+ C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt
+ C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um
+
+
+ GEN_TIME
+
+
+
+ Debug:x64
+
+
+
+
+ Debug
+
+
+
+ x64
+
+
+
+
+
+
diff --git a/scripts/build.ps1 b/scripts/build.ps1
index c752abd..56b037c 100644
--- a/scripts/build.ps1
+++ b/scripts/build.ps1
@@ -286,7 +286,7 @@ if ( $vendor -match "msvc" )
#endregion Configuration
$path_project = Join-Path $path_root 'project'
-$path_build = Join-Path $path_project 'build'
+$path_build = Join-Path $path_root 'build'
$path_deps = Join-Path $path_project 'dependencies'
$path_gen = Join-Path $path_project 'gen'
@@ -315,10 +315,9 @@ $unit = Join-Path $path_gen 'gen_handmade.cpp'
$executable = Join-Path $path_build 'gen_handmade.exe'
build-simple $includes $compiler_args $unit $executable
-write-host "Compiled Handmade Generate`n"
& $executable
-write-host "`n"
+write-host
if ( $false ) {
Remove-Item (Get-ChildItem -Path $path_build -Recurse -Force)
@@ -334,7 +333,6 @@ $compile_args = @(
)
build-simple $includes $compiler_args $unit $executable
-write-host "Compiled Handmade Runtime`n"
#endregion Handmade Runtime
Pop-Location
diff --git a/scripts/clean.ps1 b/scripts/clean.ps1
index d0f5b7d..85ac3ef 100644
--- a/scripts/clean.ps1
+++ b/scripts/clean.ps1
@@ -1,8 +1,8 @@
clear-host
$path_root = git rev-parse --show-toplevel
-$path_project = join-path $path_root "project"
-$path_build = join-path $path_project "build"
+$path_project = join-path $path_root "project"
+$path_build = join-path $path_root "build"
$path_dependencies = join-path $path_project "dependencies"
# if ( Test-Path $path_dependencies ) {
diff --git a/scripts/genccp.natstepfilter b/scripts/genccp.natstepfilter
new file mode 100644
index 0000000..403ae58
--- /dev/null
+++ b/scripts/genccp.natstepfilter
@@ -0,0 +1,30 @@
+
+
+
+ gen::.*::raw
+ NoStepInto
+
+
+ gen::Code.*::debug_str
+ NoStepInto
+
+
+ gen::Code.*::duplicate
+ NoStepInto
+
+
+ gen::Code.*::has_entries
+ NoStepInto
+
+
+ gen::Code.*::is_equal
+ NoStepInto
+
+
+ gen::Code.*::to_string
+ NoStepInto
+
+
+ gen::String::operator .*
+
+
diff --git a/scripts/gencpp.natvis b/scripts/gencpp.natvis
new file mode 100644
index 0000000..09c3b67
--- /dev/null
+++ b/scripts/gencpp.natvis
@@ -0,0 +1,682 @@
+
+
+
+
+ Data:{Data} Proc:{Proc}
+
+
+
+ NumBlocks: {NumBlocks} TotalSize: {TotalSize}
+
+
+ NumBlocks
+ FreeList
+ FreeList
+ PhysicalStart
+
+
+
+
+
+ Num:{((Header*)((char*)Data - sizeof(Header)))->Num},
+ Capacity:{((Header*)((char*)Data - sizeof(Header)))->Capacity}
+
+
+ {(Header*)((char*)Data - sizeof(Header))}
+
+ - ((Header*)((char*)Data - sizeof(Header)))->Allocator
+ - ((Header*)((char*)Data - sizeof(Header)))->Capacity
+ - ((Header*)((char*)Data - sizeof(Header)))->Num
+
+
+
+ ((Header*)((char*)Data - sizeof(Header)))->Capacity
+ Data
+
+
+
+
+
+ Len:{Len} Ptr:{Ptr, [Len]s}
+
+
+
+ null
+ {Data,na}
+
+
+ {(Header*)((char*)Data - sizeof(Header))}
+
+ - ((Header*)((char*)Data - sizeof(Header)))->Allocator
+ - ((Header*)((char*)Data - sizeof(Header)))->Capacity
+ - ((Header*)((char*)Data - sizeof(Header)))->Length
+
+
+
+
+
+
+ Length: {Length}, Capacity: {Capacity}
+
+ - Allocator
+ - Length
+ - Capacity
+
+
+
+
+ {Name} Type: {Type}
+
+ - Content
+ - Parent
+ - Prev
+ - Next
+ - NumEntries
+
+
+
+
+ Null
+ {ast->Name} Type: {ast->Type}
+
+ - ast->Content
+ - ast->Body
+ - ast->Parent
+ -
+ ast->ModuleFlags
+ - ast->ArrSpecs
+ - ast->Prev
+ - ast->Next
+ - ast->NumEntries
+
+
+
+
+ {Name} Type: {Type}
+
+ - Parent
+ - Front
+ - Back
+ - NumEntries
+
+
+
+
+ {Name} Type: {Type}
+
+ - Content
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - Content
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - ModuleFlags
+ - Attributes
+ - ParentType
+ - ParentAccess
+ - Body
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - Attributes
+ - UnderlyingType
+ - Body
+ - ModuleFlags
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - Body
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - Body
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - Content
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - Declaration
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - ModuleFlags
+ - Attributes
+ - Specs
+ - ReturnType
+ - Params
+ - Body
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - ModuleFlags
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - ModuleFlags
+ - Parent
+ - Prev
+ - Next
+ - Body
+
+
+
+
+ {Name} Type: {Type}
+
+ - ModuleFlags
+ - Attributes
+ - Specs
+ - ReturnType
+ - Op
+ - Params
+ - Body
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - Specs
+ - ValueType
+ - Body
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - ValueType
+ - Value
+ - Parent
+ - Last
+ - Next
+ - NumEntries
+
+
+
+
+ {Name} Type: {Type}
+
+ - Specs
+ - NumEntries
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - ModuleFlags
+ - Attributes
+ - ParentType
+ - ParentAccess
+ - Body
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - ModuleFlags
+ - Declaration
+ - Params
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - Attributes
+ - Specs
+ - ArrExpr
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - ModuleFlags
+ - Attributes
+ - UnderlyingType
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - ModuleFlags
+ - Attributes
+ - Body
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - ModuleFlags
+ - Attributes
+ - UnderlyingType
+ - Parent
+ - ParentAccess
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - Name
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ {Name} Type: {Type}
+
+ - ModuleFlags
+ - Attributes
+ - Specs
+ - ValueType
+ - Value
+ - Parent
+ - Prev
+ - Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->Parent
+ - ast->Front
+ - ast->Back
+ - ast->NumEntries
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->Content
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->Content
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ModuleFlags
+ - ast->Attributes
+ - ast->ParentType
+ - ast->ParentAccess
+ - ast->Body
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->Body
+ - ast->Prev
+ - ast->Next
+ - ast->Parent
+ - ast->Name
+ - ast->Type
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ModuleFlags
+ - ast->Attributes
+ - ast->UnderlyingType
+ - ast->Body
+ - ast->Prev
+ - ast->Next
+ - ast->Parent
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->Content
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->Declaration
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ModuleFlags
+ - ast->Attributes
+ - ast->Specs
+ - ast->ReturnType
+ - ast->Params
+ - ast->Body
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ModuleFlags
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ModuleFlags
+ - ast->Body
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ModuleFlags
+ - ast->Attributes
+ - ast->Specs
+ - ast->ReturnType
+ - ast->Op
+ - ast->Params
+ - ast->Body
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ValueType
+ - ast->Body
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ValueType
+ - ast->Value
+ - ast->Parent
+ - ast->Last
+ - ast->Next
+ - ast->NumEntries
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->Specs
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+ - ast->NumEntries
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ModuleFlags
+ - ast->Attributes
+ - ast->ParentType
+ - ast->ParentAccess
+ - ast->Body
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ModuleFlags
+ - ast->Params
+ - ast->Declaration
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->Attributes
+ - ast->Specs
+ - ast->ArrExpr
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ModuleFlags
+ - ast->Attributes
+ - ast->UnderlyingType
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ModuleFlags
+ - ast->Attributes
+ - ast->Body
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ModuleFlags
+ - ast->Attributes
+ - ast->UnderlyingType
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->Prev
+ - ast->Next
+ - ast->Parent
+ - ast->Name
+ - ast->Type
+
+
+
+
+ Null
+ {ast->Name} {ast->Type}
+
+ - ast->ModuleFlags
+ - ast->Attributes
+ - ast->Specs
+ - ast->ValueType
+ - ast->Value
+ - ast->Parent
+ - ast->Prev
+ - ast->Next
+
+
+
+
+ Length:{Length} Text:{Text, [Length]s} Type:{Type}
+
+
+
+ Current[ { Arr[Idx] } ] Idx:{ Idx }
+
+
+
\ No newline at end of file