commit 482de0aa7b3c592331af1fc2f8f82cf74b0a4504 Author: Evan Hemsley Date: Wed Aug 5 12:21:42 2020 -0700 initial test structure diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0678386 --- /dev/null +++ b/.gitignore @@ -0,0 +1,353 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +fnalibs/ + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*[.json, .xml, .info] + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..60b1ef4 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "FNA"] + path = FNA + url = https://github.com/FNA-XNA/FNA.git +[submodule "encompass-cs"] + path = encompass-cs + url = https://gitea.moonside.games/MoonsideGames/encompass-cs.git +[submodule "Kav"] + path = Kav + url = https://gitea.moonside.games/MoonsideGames/Kav.git +[submodule "Smuggler"] + path = Smuggler + url = https://gitea.moonside.games/MoonsideGames/Smuggler.git diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..979d368 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,20 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Attach to Core Debugger", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "Build: Core Debug", + "program": "${workspaceFolder}/KavTest/bin/Debug/netcoreapp3.1/KavTest.dll", + "args": [], + "env": { + "LD_LIBRARY_PATH": "${workspaceFolder}/KavTest/bin/Debug/netcoreapp3.1/lib64", + "DYLD_LIBRARY_PATH": "${workspaceFolder}/KavTest/bin/Debug/netcoreapp3.1/osx" + }, + "cwd": "${workspaceFolder}", + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen" + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..3eb0c76 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,224 @@ +{ + "version": "2.0.0", + "options": { + "cwd": "${workspaceRoot}" + }, + "windows": { + "options": { + "shell": { + "executable": "cmd.exe", + "args": [ + "/d", + "/c" + ] + } + } + }, + "presentation": { + "reveal": "always", + "focus": true, + "panel": "shared" + }, + "tasks": [ + { + "label": "Build: Framework Release", + "command": "msbuild", + "args": [ + "-restore:True", + "${workspaceFolder}/KavTest.Framework.sln", + "-p:Configuration=Release" + ], + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": "$msCompile" + }, + { + "label": "Run: Framework Release", + "command": "mono", + "args": [ + "KavTest.exe" + ], + "options": { + "env": { + "LD_LIBRARY_PATH": "./lib64", + "DYLD_LIBRARY_PATH": "./osx" + }, + "cwd": "${workspaceFolder}/KavTest/bin/Release/net461" + }, + "type": "process", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Build & Run: Framework Release", + "dependsOn": [ + "Build: Framework Release", + "Run: Framework Release" + ], + "dependsOrder": "sequence", + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Build: Framework Debug", + "command": "msbuild", + "args": [ + "-restore:True", + "${workspaceFolder}/KavTest.Framework.sln", + "-p:Configuration=Debug" + ], + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Run: Framework Debug", + "command": "mono", + "args": [ + "KavTest.exe" + ], + "options": { + "env": { + "LD_LIBRARY_PATH": "./lib64", + "DYLD_LIBRARY_PATH": "./osx" + }, + "cwd": "${workspaceFolder}/KavTest/bin/Debug/net461" + }, + "type": "process", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Build & Run: Framework Debug", + "dependsOn": [ + "Build: Framework Debug", + "Run: Framework Debug" + ], + "dependsOrder": "sequence", + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Build & Run: Core Debug", + "type": "shell", + "dependsOrder": "sequence", + "dependsOn": [ + "Build: Core Debug", + "Run: Core Debug" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Build: Core Debug", + "command": "dotnet", + "args": [ + "build", + "./KavTest.Core.sln", + "-f", + "netcoreapp3.1" + ], + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Run: Core Debug", + "command": "dotnet", + "args": [ + "./KavTest.dll" + ], + "options": { + "env": { + "LD_LIBRARY_PATH": "./lib64", + "DYLD_LIBRARY_PATH": "./osx" + }, + "cwd": "${workspaceFolder}/KavTest/bin/Debug/netcoreapp3.1" + }, + "type": "process", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Build: Core Release", + "command": "dotnet", + "args": [ + "build", + "./KavTest.Core.sln", + "--configuration", + "Release", + "-f", + "netcoreapp3.1" + ], + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Run: Core Release", + "command": "dotnet", + "args": [ + "./KavTest.dll" + ], + "options": { + "env": { + "LD_LIBRARY_PATH": "./lib64", + "DYLD_LIBRARY_PATH": "./osx" + }, + "cwd": "${workspaceFolder}/KavTest/bin/Release/netcoreapp3.1" + }, + "type": "process", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Build & Run: Core Release", + "dependsOrder": "sequence", + "dependsOn": [ + "Build: Core Release", + "Run: Core Release" + ], + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + } + ] +} diff --git a/FNA b/FNA new file mode 160000 index 0000000..9a8a84c --- /dev/null +++ b/FNA @@ -0,0 +1 @@ +Subproject commit 9a8a84c3d427f47759a92342aaa8f7f08e751a64 diff --git a/FNA.Settings.props b/FNA.Settings.props new file mode 100644 index 0000000..4c1d2c2 --- /dev/null +++ b/FNA.Settings.props @@ -0,0 +1,6 @@ + + + + $(DefineConstants) + + diff --git a/Kav b/Kav new file mode 160000 index 0000000..f0f0911 --- /dev/null +++ b/Kav @@ -0,0 +1 @@ +Subproject commit f0f09115f5dfbe34179bab33f60d07230aed9dd7 diff --git a/KavTest.Core.sln b/KavTest.Core.sln new file mode 100644 index 0000000..d4806a3 --- /dev/null +++ b/KavTest.Core.sln @@ -0,0 +1,48 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KavTest.Core", "KavTest\KavTest.Core.csproj", "{4589302C-174A-4173-9654-CAA6CA1B5220}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "kav", "Kav\kav.csproj", "{08398000-DF30-465A-AE07-E11D108B8A74}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|x64.ActiveCfg = Debug|Any CPU + {4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|x64.Build.0 = Debug|Any CPU + {4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|x86.ActiveCfg = Debug|Any CPU + {4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|x86.Build.0 = Debug|Any CPU + {4589302C-174A-4173-9654-CAA6CA1B5220}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4589302C-174A-4173-9654-CAA6CA1B5220}.Release|Any CPU.Build.0 = Release|Any CPU + {4589302C-174A-4173-9654-CAA6CA1B5220}.Release|x64.ActiveCfg = Release|Any CPU + {4589302C-174A-4173-9654-CAA6CA1B5220}.Release|x64.Build.0 = Release|Any CPU + {4589302C-174A-4173-9654-CAA6CA1B5220}.Release|x86.ActiveCfg = Release|Any CPU + {4589302C-174A-4173-9654-CAA6CA1B5220}.Release|x86.Build.0 = Release|Any CPU + {08398000-DF30-465A-AE07-E11D108B8A74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08398000-DF30-465A-AE07-E11D108B8A74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {08398000-DF30-465A-AE07-E11D108B8A74}.Debug|x64.ActiveCfg = Debug|Any CPU + {08398000-DF30-465A-AE07-E11D108B8A74}.Debug|x64.Build.0 = Debug|Any CPU + {08398000-DF30-465A-AE07-E11D108B8A74}.Debug|x86.ActiveCfg = Debug|Any CPU + {08398000-DF30-465A-AE07-E11D108B8A74}.Debug|x86.Build.0 = Debug|Any CPU + {08398000-DF30-465A-AE07-E11D108B8A74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08398000-DF30-465A-AE07-E11D108B8A74}.Release|Any CPU.Build.0 = Release|Any CPU + {08398000-DF30-465A-AE07-E11D108B8A74}.Release|x64.ActiveCfg = Release|Any CPU + {08398000-DF30-465A-AE07-E11D108B8A74}.Release|x64.Build.0 = Release|Any CPU + {08398000-DF30-465A-AE07-E11D108B8A74}.Release|x86.ActiveCfg = Release|Any CPU + {08398000-DF30-465A-AE07-E11D108B8A74}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/KavTest.Framework.sln b/KavTest.Framework.sln new file mode 100644 index 0000000..4cb6f06 --- /dev/null +++ b/KavTest.Framework.sln @@ -0,0 +1,62 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNATemplate.Framework", "KavTest\KavTest.Framework.csproj", "{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "kav", "Kav\kav.csproj", "{9B2EC2DE-7E2C-4768-B812-43AB4C7E31C5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Smuggler", "Smuggler\Smuggler.csproj", "{06664804-2B01-46F5-B8EC-07E5E2C1EADC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x64.ActiveCfg = Debug|Any CPU + {9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x64.Build.0 = Debug|Any CPU + {9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x86.ActiveCfg = Debug|Any CPU + {9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x86.Build.0 = Debug|Any CPU + {9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|Any CPU.Build.0 = Release|Any CPU + {9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|x64.ActiveCfg = Release|Any CPU + {9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|x64.Build.0 = Release|Any CPU + {9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|x86.ActiveCfg = Release|Any CPU + {9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|x86.Build.0 = Release|Any CPU + {9B2EC2DE-7E2C-4768-B812-43AB4C7E31C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9B2EC2DE-7E2C-4768-B812-43AB4C7E31C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B2EC2DE-7E2C-4768-B812-43AB4C7E31C5}.Debug|x64.ActiveCfg = Debug|Any CPU + {9B2EC2DE-7E2C-4768-B812-43AB4C7E31C5}.Debug|x64.Build.0 = Debug|Any CPU + {9B2EC2DE-7E2C-4768-B812-43AB4C7E31C5}.Debug|x86.ActiveCfg = Debug|Any CPU + {9B2EC2DE-7E2C-4768-B812-43AB4C7E31C5}.Debug|x86.Build.0 = Debug|Any CPU + {9B2EC2DE-7E2C-4768-B812-43AB4C7E31C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9B2EC2DE-7E2C-4768-B812-43AB4C7E31C5}.Release|Any CPU.Build.0 = Release|Any CPU + {9B2EC2DE-7E2C-4768-B812-43AB4C7E31C5}.Release|x64.ActiveCfg = Release|Any CPU + {9B2EC2DE-7E2C-4768-B812-43AB4C7E31C5}.Release|x64.Build.0 = Release|Any CPU + {9B2EC2DE-7E2C-4768-B812-43AB4C7E31C5}.Release|x86.ActiveCfg = Release|Any CPU + {9B2EC2DE-7E2C-4768-B812-43AB4C7E31C5}.Release|x86.Build.0 = Release|Any CPU + {06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Debug|x64.ActiveCfg = Debug|Any CPU + {06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Debug|x64.Build.0 = Debug|Any CPU + {06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Debug|x86.ActiveCfg = Debug|x86 + {06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Debug|x86.Build.0 = Debug|x86 + {06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Release|Any CPU.Build.0 = Release|Any CPU + {06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Release|x64.ActiveCfg = Release|Any CPU + {06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Release|x64.Build.0 = Release|Any CPU + {06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Release|x86.ActiveCfg = Release|x86 + {06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Release|x86.Build.0 = Release|x86 + EndGlobalSection +EndGlobal diff --git a/KavTest/Components/CameraComponent.cs b/KavTest/Components/CameraComponent.cs new file mode 100644 index 0000000..7643ab3 --- /dev/null +++ b/KavTest/Components/CameraComponent.cs @@ -0,0 +1,15 @@ +using Encompass; +using Kav; + +namespace KavTest.Components +{ + public struct CameraComponent : IComponent + { + public Camera Camera { get; } + + public CameraComponent(Camera camera) + { + Camera = camera; + } + } +} diff --git a/KavTest/Components/ModelComponent.cs b/KavTest/Components/ModelComponent.cs new file mode 100644 index 0000000..6711d09 --- /dev/null +++ b/KavTest/Components/ModelComponent.cs @@ -0,0 +1,15 @@ +using Encompass; +using Kav; + +namespace KavTest.Components +{ + public struct ModelComponent : IComponent + { + public Model Model { get; } + + public ModelComponent(Model model) + { + Model = model; + } + } +} diff --git a/KavTest/Components/PointLightComponent.cs b/KavTest/Components/PointLightComponent.cs new file mode 100644 index 0000000..e0d22d9 --- /dev/null +++ b/KavTest/Components/PointLightComponent.cs @@ -0,0 +1,17 @@ +using Encompass; +using Microsoft.Xna.Framework; + +namespace KavTest.Components +{ + public struct PointLightComponent : IComponent + { + public Color Color { get; } + public float Intensity { get; } + + public PointLightComponent(Color color, float intensity) + { + Color = color; + Intensity = intensity; + } + } +} diff --git a/KavTest/Components/README.md b/KavTest/Components/README.md new file mode 100644 index 0000000..9d15726 --- /dev/null +++ b/KavTest/Components/README.md @@ -0,0 +1 @@ +Put your Component structs here. diff --git a/KavTest/Components/TransformComponent.cs b/KavTest/Components/TransformComponent.cs new file mode 100644 index 0000000..779c69b --- /dev/null +++ b/KavTest/Components/TransformComponent.cs @@ -0,0 +1,15 @@ +using Encompass; +using Microsoft.Xna.Framework; + +namespace KavTest.Components +{ + public struct TransformComponent : IComponent + { + public Matrix Transform { get; } + + public TransformComponent(Matrix transform) + { + Transform = transform; + } + } +} diff --git a/KavTest/Content/README.md b/KavTest/Content/README.md new file mode 100644 index 0000000..d05e474 --- /dev/null +++ b/KavTest/Content/README.md @@ -0,0 +1 @@ +Insert your content files here (sprites, sound, etc) diff --git a/KavTest/Content/cube.glb b/KavTest/Content/cube.glb new file mode 100644 index 0000000..7cbcddf Binary files /dev/null and b/KavTest/Content/cube.glb differ diff --git a/KavTest/DllMap.cs b/KavTest/DllMap.cs new file mode 100644 index 0000000..3536d1f --- /dev/null +++ b/KavTest/DllMap.cs @@ -0,0 +1,259 @@ +// only works in .NET Core. disable in .NET framework + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Xml.Linq; + +public static class DllMap +{ + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetDefaultDllDirectories(int directoryFlags); + + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] + static extern void AddDllDirectory(string lpPathName); + + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetDllDirectory(string lpPathName); + + const int LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000; + + public static Dictionary MapDictionary; + public static string OS; + public static string CPU; + public static bool Optimise; + + public static void Initialise(bool optimise = true) + { + Optimise = optimise; + + // Our executabe needs to know how to find the native libraries + // For Windows, we can set this to be x86 or x64 directory at runtime (below) + // For Linux we need to move our native libraries to 'netcoredeps' which is set by .net core + // For OSX we need to set an environment variable (DYLD_LIBRARY_PATH) outside of the process by a script + if (Environment.OSVersion.Platform == PlatformID.Win32NT) + { + try + { + SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); + AddDllDirectory(Path.Combine( + AppDomain.CurrentDomain.BaseDirectory, + Environment.Is64BitProcess ? "x64" : "x86" + )); + } + catch + { + // Pre-Windows 7, KB2533623 + SetDllDirectory(Path.Combine( + AppDomain.CurrentDomain.BaseDirectory, + Environment.Is64BitProcess ? "x64" : "x86" + )); + } + } + + // .NET Core also doesn't use DllImport but we can replicate this using NativeLibrary as per below + // Uses FNA.dll.config to dictate what the name of the native library is per platform and architecture + var fnaAssembly = Assembly.GetAssembly(typeof(Microsoft.Xna.Framework.Graphics.ColorWriteChannels)); + DllMap.Register(fnaAssembly); + } + + // Register a call-back for native library resolution. + public static void Register(Assembly assembly) + { + NativeLibrary.SetDllImportResolver(assembly, MapAndLoad); + + // Do setup so that MapLibraryName is faster than reading the XML each time + + // 1) Get platform & cpu + OS = GetCurrentPlatform().ToString().ToLowerInvariant(); + CPU = GetCurrentRuntimeArchitecture().ToString().ToLowerInvariant(); + + // 2) Setup MapDictionary + // For Windows use hardcoded values + // Why? This is our development platform and we wanted the fastest start time possible (eliminates XML Load) + if (OS == "windows" && Optimise) + { + MapDictionary = new Dictionary(); + MapDictionary.Add("SDL2", "SDL2.dll"); + MapDictionary.Add("SDL_image", "SDL_image.dll"); + MapDictionary.Add("FAudio", "FAudio.dll"); + } + else + { + // For every other platform use XML file + // Read in config XML and only store details we're interested in within MapDictionary + string xmlPath = Path.Combine(Path.GetDirectoryName(assembly.Location), + Path.GetFileNameWithoutExtension(assembly.Location) + ".dll.config"); + + if (!File.Exists(xmlPath)) + { + Console.WriteLine($"=== Cannot find XML: " + xmlPath); + return; + } + + XElement root = XElement.Load(xmlPath); + + MapDictionary = new Dictionary(); + ParseXml(root, true); // Direct match on OS & CPU first + ParseXml(root, false); // Loose match on CPU second (won't allow duplicates) + } + } + + private static void ParseXml(XElement root, bool matchCPU) + { + foreach (var el in root.Elements("dllmap")) + { + // Ignore entries for other OSs + if (el.Attribute("os").ToString().IndexOf(OS) < 0) + continue; + + // Ignore entries for other CPUs + if (matchCPU) + { + if (el.Attribute("cpu") == null) + continue; + if (el.Attribute("cpu").ToString().IndexOf(CPU) < 0) + continue; + } + else + { + if (el.Attribute("cpu") != null && el.Attribute("cpu").ToString().IndexOf(CPU) < 0) + continue; + } + + string oldLib = el.Attribute("dll").Value; + string newLib = el.Attribute("target").Value; + if (string.IsNullOrWhiteSpace(oldLib) || string.IsNullOrWhiteSpace(newLib)) + continue; + + // Don't allow duplicates + if (MapDictionary.ContainsKey(oldLib)) + continue; + + MapDictionary.Add(oldLib, newLib); + } + } + + // The callback: which loads the mapped libray in place of the original + private static IntPtr MapAndLoad(string libraryName, Assembly assembly, DllImportSearchPath? dllImportSearchPath) + { + string mappedName = null; + mappedName = MapLibraryName(assembly.Location, libraryName, out mappedName) ? mappedName : libraryName; + return NativeLibrary.Load(mappedName, assembly, dllImportSearchPath); + } + + // Parse the assembly.xml file, and map the old name to the new name of a library. + private static bool MapLibraryName(string assemblyLocation, string originalLibName, out string mappedLibName) + { + if (MapDictionary.TryGetValue(originalLibName, out mappedLibName)) + return true; + else + return false; + } + + // Below pinched from Mono.DllMap project: https://github.com/Firwood-Software/AdvancedDLSupport/tree/1b7394211a655b2f77649ce3b610a3161215cbdc/Mono.DllMap + public static DllMapOS GetCurrentPlatform() + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + return DllMapOS.Linux; + } + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + return DllMapOS.Windows; + } + + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + return DllMapOS.OSX; + } + + var operatingDesc = RuntimeInformation.OSDescription.ToUpperInvariant(); + foreach (var system in Enum.GetValues(typeof(DllMapOS)).Cast() + .Except(new[] { DllMapOS.Linux, DllMapOS.Windows, DllMapOS.OSX })) + { + if (operatingDesc.Contains(system.ToString().ToUpperInvariant())) + { + return system; + } + } + + throw new PlatformNotSupportedException($"Couldn't detect platform: {RuntimeInformation.OSDescription}"); + } + + public static DllMapArchitecture GetCurrentRuntimeArchitecture() + { + switch (RuntimeInformation.ProcessArchitecture) + { + case Architecture.Arm: + { + return DllMapArchitecture.ARM; + } + case Architecture.X64: + { + return DllMapArchitecture.x86_64; + } + case Architecture.X86: + { + return DllMapArchitecture.x86; + } + } + + typeof(object).Module.GetPEKind(out _, out var machine); + switch (machine) + { + case ImageFileMachine.I386: + { + return DllMapArchitecture.x86; + } + case ImageFileMachine.AMD64: + { + return DllMapArchitecture.x86_64; + } + case ImageFileMachine.ARM: + { + return DllMapArchitecture.ARM; + } + case ImageFileMachine.IA64: + { + return DllMapArchitecture.IA64; + } + } + throw new PlatformNotSupportedException("Couldn't detect the current architecture."); + } + + public enum DllMapOS + { + Linux = 1 << 0, + OSX = 1 << 1, + Solaris = 1 << 2, + FreeBSD = 1 << 3, + OpenBSD = 1 << 4, + NetBSD = 1 << 5, + Windows = 1 << 6, + AIX = 1 << 7, + HPUX = 1 << 8 + } + + public enum DllMapArchitecture + { + x86 = 1 << 0, + x86_64 = 1 << 1, + SPARC = 1 << 2, + PPC = 1 << 3, + S390 = 1 << 4, + S390X = 1 << 5, + ARM = 1 << 6, + ARMV8 = 1 << 7, + MIPS = 1 << 8, + Alpha = 1 << 9, + HPPA = 1 << 10, + IA64 = 1 << 11 + } +} diff --git a/KavTest/Engines/README.md b/KavTest/Engines/README.md new file mode 100644 index 0000000..9937c03 --- /dev/null +++ b/KavTest/Engines/README.md @@ -0,0 +1 @@ +Put your Engine classes here. diff --git a/KavTest/Engines/Spawners/LightBulbSpawner.cs b/KavTest/Engines/Spawners/LightBulbSpawner.cs new file mode 100644 index 0000000..ca8c814 --- /dev/null +++ b/KavTest/Engines/Spawners/LightBulbSpawner.cs @@ -0,0 +1,17 @@ +using Encompass; +using KavTest.Components; +using KavTest.Messages; + +namespace KavTest.Spawners +{ + public class LightBulbSpawner : Spawner + { + protected override void Spawn(in LightBulbSpawnMessage message) + { + var entity = CreateEntity(); + + AddComponent(entity, new TransformComponent(message.Transform)); + AddComponent(entity, new PointLightComponent(message.Color, message.Intensity)); + } + } +} diff --git a/KavTest/Engines/Spawners/RustyBallSpawner.cs b/KavTest/Engines/Spawners/RustyBallSpawner.cs new file mode 100644 index 0000000..b1d16c5 --- /dev/null +++ b/KavTest/Engines/Spawners/RustyBallSpawner.cs @@ -0,0 +1,25 @@ +using Encompass; +using Kav; +using KavTest.Components; +using KavTest.Messages; + +namespace KavTest.Spawners +{ + public class RustyBallSpawner : Spawner + { + private Model RustyBallModel { get; } + + public RustyBallSpawner(Model rustyBallModel) + { + RustyBallModel = rustyBallModel; + } + + protected override void Spawn(in RustyBallSpawnMessage message) + { + var entity = CreateEntity(); + + AddComponent(entity, new TransformComponent(message.Transform)); + AddComponent(entity, new ModelComponent(RustyBallModel)); + } + } +} diff --git a/KavTest/KavTest.Core.csproj b/KavTest/KavTest.Core.csproj new file mode 100644 index 0000000..5da37f0 --- /dev/null +++ b/KavTest/KavTest.Core.csproj @@ -0,0 +1,31 @@ + + + obj\$(MSBuildKavTest) + + + + WinExe + netcoreapp3.1 + KavTest + false + false + 8.0 + KavTest.Program + KavTest + KavTest + true + win-x64;osx-x64;linux-x64 + + + + + Always + + + + + + + + + diff --git a/KavTest/KavTest.Framework.csproj b/KavTest/KavTest.Framework.csproj new file mode 100644 index 0000000..0bf3791 --- /dev/null +++ b/KavTest/KavTest.Framework.csproj @@ -0,0 +1,37 @@ + + + obj\$(MSBuildKavTest) + + + + WinExe + net461 + KavTest + false + false + 8.0 + KavTest.Program + KavTest + KavTest + true + win-x64;osx-x64;linux-x64 + + + + $(DefaultItemExcludes);DllMap.cs + + + + Always + + + + + + + + + + + + diff --git a/KavTest/KavTestGame.cs b/KavTest/KavTestGame.cs new file mode 100644 index 0000000..3ccaa55 --- /dev/null +++ b/KavTest/KavTestGame.cs @@ -0,0 +1,83 @@ +using System.IO; +using Encompass; +using KavTest.Components; +using KavTest.Messages; +using KavTest.Renderers; +using KavTest.Spawners; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace KavTest +{ + class KavTestGame : Game + { + GraphicsDeviceManager graphics; + + WorldBuilder WorldBuilder { get; } = new WorldBuilder(); + World World { get; set; } + + public KavTestGame() + { + graphics = new GraphicsDeviceManager(this); + graphics.PreferredBackBufferWidth = 1280; + graphics.PreferredBackBufferHeight = 720; + graphics.PreferMultiSampling = true; + Content.RootDirectory = "Content"; + + Window.AllowUserResizing = true; + IsMouseVisible = true; + } + + protected override void LoadContent() + { + var rustyBallModel = ModelLoader.Load( + GraphicsDevice, + Smuggler.Importer.ImportGLB(GraphicsDevice, File.OpenRead("Content/cube.glb")) + ); + + WorldBuilder.AddEngine(new RustyBallSpawner(rustyBallModel)); + WorldBuilder.AddEngine(new LightBulbSpawner()); + WorldBuilder.AddGeneralRenderer(new SceneRenderer(GraphicsDevice), 0); + + WorldBuilder.SendMessage(new RustyBallSpawnMessage( + Matrix.CreateTranslation(0, 0, 0) + )); + WorldBuilder.SendMessage(new LightBulbSpawnMessage( + Matrix.CreateTranslation(10, 0, -5), + Color.White, + 300f + )); + + var cameraMatrix = Matrix.CreateLookAt(new Vector3(10, 0, 0), Vector3.Zero, Vector3.Up); + var cameraEntity = WorldBuilder.CreateEntity(); + WorldBuilder.SetComponent(cameraEntity, new CameraComponent( + new Kav.Camera( + cameraMatrix + ) + )); + + World = WorldBuilder.Build(); + } + + protected override void UnloadContent() + { + base.UnloadContent(); + } + + protected override void Update(GameTime gameTime) + { + World.Update(gameTime.ElapsedGameTime.TotalSeconds); + + base.Update(gameTime); + } + + protected override void Draw(GameTime gameTime) + { + GraphicsDevice.Clear(Color.CornflowerBlue); + + World.Draw(); + + base.Draw(gameTime); + } + } +} diff --git a/KavTest/Messages/LightBulbSpawnMessage.cs b/KavTest/Messages/LightBulbSpawnMessage.cs new file mode 100644 index 0000000..5f308d3 --- /dev/null +++ b/KavTest/Messages/LightBulbSpawnMessage.cs @@ -0,0 +1,19 @@ +using Encompass; +using Microsoft.Xna.Framework; + +namespace KavTest.Messages +{ + public struct LightBulbSpawnMessage : IMessage + { + public Matrix Transform { get; } + public Color Color { get; } + public float Intensity { get; } + + public LightBulbSpawnMessage(Matrix transform, Color color, float intensity) + { + Transform = transform; + Color = color; + Intensity = intensity; + } + } +} diff --git a/KavTest/Messages/README.md b/KavTest/Messages/README.md new file mode 100644 index 0000000..b0c2354 --- /dev/null +++ b/KavTest/Messages/README.md @@ -0,0 +1 @@ +Put your Message structs here. diff --git a/KavTest/Messages/RustyBallSpawnMessage.cs b/KavTest/Messages/RustyBallSpawnMessage.cs new file mode 100644 index 0000000..455489d --- /dev/null +++ b/KavTest/Messages/RustyBallSpawnMessage.cs @@ -0,0 +1,16 @@ +using Encompass; +using Kav; +using Microsoft.Xna.Framework; + +namespace KavTest.Messages +{ + public struct RustyBallSpawnMessage : IMessage + { + public Matrix Transform { get; } + + public RustyBallSpawnMessage(Matrix transform) + { + Transform = transform; + } + } +} diff --git a/KavTest/Program.cs b/KavTest/Program.cs new file mode 100644 index 0000000..ae1f0e0 --- /dev/null +++ b/KavTest/Program.cs @@ -0,0 +1,47 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Runtime.InteropServices; + +namespace KavTest +{ + class Program + { + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetDllDirectory(string lpPathName); + + + static void Main(string[] args) + { +#if NETCOREAPP + DllMap.Initialise(false); +#endif + + // https://github.com/FNA-XNA/FNA/wiki/4:-FNA-and-Windows-API#64-bit-support + if (Environment.OSVersion.Platform == PlatformID.Win32NT) + { + SetDllDirectory(Path.Combine( + AppDomain.CurrentDomain.BaseDirectory, + Environment.Is64BitProcess ? "x64" : "x86" + )); + } + + // https://github.com/FNA-XNA/FNA/wiki/7:-FNA-Environment-Variables#fna_graphics_enable_highdpi + // NOTE: from documentation: + // Lastly, when packaging for macOS, be sure this is in your app bundle's Info.plist: + // NSHighResolutionCapable + // True + Environment.SetEnvironmentVariable("FNA_GRAPHICS_ENABLE_HIGHDPI", "1"); + + using (KavTestGame game = new KavTestGame()) + { + bool isHighDPI = Environment.GetEnvironmentVariable("FNA_GRAPHICS_ENABLE_HIGHDPI") == "1"; + if (isHighDPI) + Debug.WriteLine("HiDPI Enabled"); + + game.Run(); + } + } + } +} diff --git a/KavTest/Renderers/README.md b/KavTest/Renderers/README.md new file mode 100644 index 0000000..e1dc6ea --- /dev/null +++ b/KavTest/Renderers/README.md @@ -0,0 +1 @@ +Put your Renderer classes here. diff --git a/KavTest/Renderers/SceneRenderer.cs b/KavTest/Renderers/SceneRenderer.cs new file mode 100644 index 0000000..b0ecc7b --- /dev/null +++ b/KavTest/Renderers/SceneRenderer.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using Encompass; +using Kav; +using KavTest.Components; +using Microsoft.Xna.Framework.Graphics; + +namespace KavTest.Renderers +{ + public class SceneRenderer : GeneralRenderer + { + private GraphicsDevice GraphicsDevice { get; } + + private IEnumerable Models + { + get + { + foreach (var entity in ReadEntitiesAsEnumerable()) + { + var transformComponent = GetComponent(entity); + var modelComponent = GetComponent(entity); + + modelComponent.Model.ApplyTransform(transformComponent.Transform); + yield return modelComponent.Model; + } + } + } + + private IEnumerable PointLights + { + get + { + foreach (var entity in ReadEntitiesAsEnumerable()) + { + var transformComponent = GetComponent(entity); + var pointLightComponent = GetComponent(entity); + + yield return new PointLight( + transformComponent.Transform.Translation, + pointLightComponent.Color, + pointLightComponent.Intensity + ); + } + } + } + + public SceneRenderer(GraphicsDevice graphicsDevice) + { + GraphicsDevice = graphicsDevice; + } + + public override void Render() + { + if (SomeComponent()) + { + var cameraComponent = ReadComponent(); + + Kav.Renderer.Render( + GraphicsDevice, + cameraComponent.Camera, + Models, + PointLights + ); + } + } + } +} diff --git a/KavTest/Utility/ModelLoader.cs b/KavTest/Utility/ModelLoader.cs new file mode 100644 index 0000000..629e3c4 --- /dev/null +++ b/KavTest/Utility/ModelLoader.cs @@ -0,0 +1,58 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework.Graphics; + +namespace KavTest +{ + public static class ModelLoader + { + public static Kav.Model Load(GraphicsDevice graphicsDevice, Smuggler.ModelData modelData) + { + var meshes = new List(); + + foreach (var meshData in modelData.Meshes) + { + var meshParts = new List(); + + foreach (var meshPartData in meshData.MeshParts) + { + var effect = new Kav.PBREffect( + graphicsDevice + ) + { + Albedo = meshPartData.Albedo, + Metallic = meshPartData.Metallic, + Roughness = meshPartData.Roughness, + + AlbedoTexture = meshPartData.AlbedoTexture, + NormalTexture = meshPartData.NormalTexture, + MetallicRoughnessTexture = meshPartData.MetallicRoughnessTexture + }; + + var triangles = new Kav.Triangle[meshPartData.Triangles.Length]; + for (int i = 0; i < meshPartData.Triangles.Length; i++) + { + var smugglerTriangle = meshPartData.Triangles[i]; + + triangles[i] = new Kav.Triangle( + smugglerTriangle.A, + smugglerTriangle.B, + smugglerTriangle.C + ); + } + + meshParts.Add(new Kav.MeshPart( + meshPartData.VertexBuffer, + meshPartData.IndexBuffer, + meshPartData.Positions, + triangles, + effect + )); + } + + meshes.Add(new Kav.Mesh(meshParts.ToArray())); + } + + return new Kav.Model(meshes.ToArray()); + } + } +} diff --git a/KavTest/Utility/README.md b/KavTest/Utility/README.md new file mode 100644 index 0000000..72b4269 --- /dev/null +++ b/KavTest/Utility/README.md @@ -0,0 +1 @@ +Put your static Utility classes here. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4462ea0 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# Encompass-FNA-Template + +Template (and VSCode build tasks) for developing a cross-platform multi-target .NET Framework and .NET Core game using Encompass and FNA. + +## Features + +- Includes project boilerplate code +- Build tasks for both .NET Framework and .NET Core side by side +- Press F5 to build and debug in-editor with Core Debugger + +## Requirements + +- [Git](https://git-scm.com/) +- [Git for Windows](https://gitforwindows.org/) if on Windows +- [Visual Studio Code](https://code.visualstudio.com/) +- [VSCode C# Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp) +- [.NET Core SDK](https://dotnet.microsoft.com/download/dotnet-core) +- [.NET Framework SDK](https://dotnet.microsoft.com/download/visual-studio-sdks) or [Mono](https://www.mono-project.com/) + + +## Installation + +- Make sure you have Git Bash from Git for Windows if you are on Windows +- Download this repository +- Run `install.sh` +- Move the newly created project directory wherever you want + +## Usage + +- Open the project directory in VSCode +- Press Ctrl-Shift-B to open the build tasks menu +- `Framework` tasks use .NET Framework or Mono to build and run +- `Core` tasks use .NET Core to build and run +- Press F5 to build and debug with Core Debugger + +## Acknowledgments + +Thanks to Andrew Russell and Caleb Cornett's FNA templates for a starting point for this template. diff --git a/Smuggler b/Smuggler new file mode 160000 index 0000000..d670a0e --- /dev/null +++ b/Smuggler @@ -0,0 +1 @@ +Subproject commit d670a0ecbd9c3ebb5e8f0b8ae7645c492e405e67 diff --git a/build/CopyFNALibs.targets b/build/CopyFNALibs.targets new file mode 100644 index 0000000..3d32f23 --- /dev/null +++ b/build/CopyFNALibs.targets @@ -0,0 +1,23 @@ + + + + + + %(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + %(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + osx\%(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + lib64\%(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + + diff --git a/encompass-cs b/encompass-cs new file mode 160000 index 0000000..73ea456 --- /dev/null +++ b/encompass-cs @@ -0,0 +1 @@ +Subproject commit 73ea4568ab277493c6717fa004cf19f9b7aae449