Browse Source

initial test structure

pull/1/head
Evan Hemsley 9 months ago
commit
482de0aa7b
35 changed files with 1517 additions and 0 deletions
  1. +353
    -0
      .gitignore
  2. +12
    -0
      .gitmodules
  3. +20
    -0
      .vscode/launch.json
  4. +224
    -0
      .vscode/tasks.json
  5. +1
    -0
      FNA
  6. +6
    -0
      FNA.Settings.props
  7. +1
    -0
      Kav
  8. +48
    -0
      KavTest.Core.sln
  9. +62
    -0
      KavTest.Framework.sln
  10. +15
    -0
      KavTest/Components/CameraComponent.cs
  11. +15
    -0
      KavTest/Components/ModelComponent.cs
  12. +17
    -0
      KavTest/Components/PointLightComponent.cs
  13. +1
    -0
      KavTest/Components/README.md
  14. +15
    -0
      KavTest/Components/TransformComponent.cs
  15. +1
    -0
      KavTest/Content/README.md
  16. BIN
      KavTest/Content/cube.glb
  17. +259
    -0
      KavTest/DllMap.cs
  18. +1
    -0
      KavTest/Engines/README.md
  19. +17
    -0
      KavTest/Engines/Spawners/LightBulbSpawner.cs
  20. +25
    -0
      KavTest/Engines/Spawners/RustyBallSpawner.cs
  21. +31
    -0
      KavTest/KavTest.Core.csproj
  22. +37
    -0
      KavTest/KavTest.Framework.csproj
  23. +83
    -0
      KavTest/KavTestGame.cs
  24. +19
    -0
      KavTest/Messages/LightBulbSpawnMessage.cs
  25. +1
    -0
      KavTest/Messages/README.md
  26. +16
    -0
      KavTest/Messages/RustyBallSpawnMessage.cs
  27. +47
    -0
      KavTest/Program.cs
  28. +1
    -0
      KavTest/Renderers/README.md
  29. +67
    -0
      KavTest/Renderers/SceneRenderer.cs
  30. +58
    -0
      KavTest/Utility/ModelLoader.cs
  31. +1
    -0
      KavTest/Utility/README.md
  32. +38
    -0
      README.md
  33. +1
    -0
      Smuggler
  34. +23
    -0
      build/CopyFNALibs.targets
  35. +1
    -0
      encompass-cs

+ 353
- 0
.gitignore View File

@ -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/

+ 12
- 0
.gitmodules View File

@ -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

+ 20
- 0
.vscode/launch.json View File

@ -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"
}
]
}

+ 224
- 0
.vscode/tasks.json View File

@ -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": []
}
]
}

+ 1
- 0
FNA

@ -0,0 +1 @@
Subproject commit 9a8a84c3d427f47759a92342aaa8f7f08e751a64

+ 6
- 0
FNA.Settings.props View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DefineConstants>$(DefineConstants)</DefineConstants>
</PropertyGroup>
</Project>

+ 1
- 0
Kav

@ -0,0 +1 @@
Subproject commit f0f09115f5dfbe34179bab33f60d07230aed9dd7

+ 48
- 0
KavTest.Core.sln View File

@ -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

+ 62
- 0
KavTest.Framework.sln View File

@ -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

+ 15
- 0
KavTest/Components/CameraComponent.cs View File

@ -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;
}
}
}

+ 15
- 0
KavTest/Components/ModelComponent.cs View File

@ -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;
}
}
}

+ 17
- 0
KavTest/Components/PointLightComponent.cs View File

@ -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;
}
}
}

+ 1
- 0
KavTest/Components/README.md View File

@ -0,0 +1 @@
Put your Component structs here.

+ 15
- 0
KavTest/Components/TransformComponent.cs View File

@ -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;
}
}
}

+ 1
- 0
KavTest/Content/README.md View File

@ -0,0 +1 @@
Insert your content files here (sprites, sound, etc)

BIN
KavTest/Content/cube.glb View File


+ 259
- 0
KavTest/DllMap.cs View File

@ -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<string, string> 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<string, string>();
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<string, string>();
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<DllMapOS>()
.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
}
}

+ 1
- 0
KavTest/Engines/README.md View File

@ -0,0 +1 @@
Put your Engine classes here.

+ 17
- 0
KavTest/Engines/Spawners/LightBulbSpawner.cs View File

@ -0,0 +1,17 @@
using Encompass;
using KavTest.Components;
using KavTest.Messages;
namespace KavTest.Spawners
{
public class LightBulbSpawner : Spawner<LightBulbSpawnMessage>
{
protected override void Spawn(in LightBulbSpawnMessage message)
{
var entity = CreateEntity();
AddComponent(entity, new TransformComponent(message.Transform));
AddComponent(entity, new PointLightComponent(message.Color, message.Intensity));
}
}
}

+ 25
- 0
KavTest/Engines/Spawners/RustyBallSpawner.cs View File

@ -0,0 +1,25 @@
using Encompass;
using Kav;
using KavTest.Components;
using KavTest.Messages;
namespace KavTest.Spawners
{
public class RustyBallSpawner : Spawner<RustyBallSpawnMessage>
{
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));
}
}
}

+ 31
- 0
KavTest/KavTest.Core.csproj View File

@ -0,0 +1,31 @@
<Project>
<PropertyGroup>
<BaseIntermediateOutputPath>obj\$(MSBuildKavTest)</BaseIntermediateOutputPath>
</PropertyGroup>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetName>KavTest</TargetName>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<LangVersion>8.0</LangVersion>
<StartupObject>KavTest.Program</StartupObject>
<AssemblyName>KavTest</AssemblyName>
<RootNamespace>KavTest</RootNamespace>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<ApplicationIcon/>
</PropertyGroup>
<ItemGroup>
<Content Include="Content\**\*.*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FNA\FNA.Core.csproj"/>
<ProjectReference Include="..\encompass-cs\encompass-cs\encompass-cs.csproj" />
</ItemGroup>
<Import Project="..\build\CopyFNALibs.targets"/>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
</Project>

+ 37
- 0
KavTest/KavTest.Framework.csproj View File

@ -0,0 +1,37 @@
<Project>
<PropertyGroup>
<BaseIntermediateOutputPath>obj\$(MSBuildKavTest)</BaseIntermediateOutputPath>
</PropertyGroup>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net461</TargetFramework>
<TargetName>KavTest</TargetName>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<LangVersion>8.0</LangVersion>
<StartupObject>KavTest.Program</StartupObject>
<AssemblyName>KavTest</AssemblyName>
<RootNamespace>KavTest</RootNamespace>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<ApplicationIcon/>
</PropertyGroup>
<PropertyGroup>
<DefaultItemExcludes>$(DefaultItemExcludes);DllMap.cs</DefaultItemExcludes>
</PropertyGroup>
<ItemGroup>
<Content Include="Content\**\*.*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FNA\FNA.csproj"/>
<ProjectReference Include="..\encompass-cs\encompass-cs\encompass-cs.csproj" />
<ProjectReference Include="..\Kav\Kav.csproj" />
<ProjectReference Include="..\Smuggler\Smuggler.csproj" />
<ProjectReference Include="..\NoAlloq\NoAlloq\NoAlloq.csproj" />
</ItemGroup>
<Import Project="..\build\CopyFNALibs.targets"/>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
</Project>

+ 83
- 0
KavTest/KavTestGame.cs View File

@ -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);
}
}
}

+ 19
- 0
KavTest/Messages/LightBulbSpawnMessage.cs View File

@ -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;
}
}
}

+ 1
- 0
KavTest/Messages/README.md View File

@ -0,0 +1 @@
Put your Message structs here.

+ 16
- 0
KavTest/Messages/RustyBallSpawnMessage.cs View File

@ -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;
}
}
}

+ 47
- 0
KavTest/Program.cs View File

@ -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:
// <key>NSHighResolutionCapable</key>
// <string>True</string>
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();
}
}
}
}

+ 1
- 0
KavTest/Renderers/README.md View File

@ -0,0 +1 @@
Put your Renderer classes here.

+ 67
- 0
KavTest/Renderers/SceneRenderer.cs View File

@ -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<Kav.Model> Models
{
get
{
foreach (var entity in ReadEntitiesAsEnumerable<ModelComponent>())
{
var transformComponent = GetComponent<TransformComponent>(entity);
var modelComponent = GetComponent<ModelComponent>(entity);
modelComponent.Model.ApplyTransform(transformComponent.Transform);
yield return modelComponent.Model;
}
}
}
private IEnumerable<PointLight> PointLights
{
get
{
foreach (var entity in ReadEntitiesAsEnumerable<PointLightComponent>())
{
var transformComponent = GetComponent<TransformComponent>(entity);
var pointLightComponent = GetComponent<PointLightComponent>(entity);
yield return new PointLight(
transformComponent.Transform.Translation,
pointLightComponent.Color,
pointLightComponent.Intensity
);
}
}
}
public SceneRenderer(GraphicsDevice graphicsDevice)
{
GraphicsDevice = graphicsDevice;
}
public override void Render()
{
if (SomeComponent<CameraComponent>())
{
var cameraComponent = ReadComponent<CameraComponent>();
Kav.Renderer.Render(
GraphicsDevice,
cameraComponent.Camera,
Models,
PointLights
);
}
}
}
}

+ 58
- 0
KavTest/Utility/ModelLoader.cs View File

@ -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<Kav.Mesh>();
foreach (var meshData in modelData.Meshes)
{
var meshParts = new List<Kav.MeshPart>();
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());
}
}
}

+ 1
- 0
KavTest/Utility/README.md View File

@ -0,0 +1 @@
Put your static Utility classes here.

+ 38
- 0
README.md View File

@ -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.

+ 1
- 0
Smuggler

@ -0,0 +1 @@
Subproject commit d670a0ecbd9c3ebb5e8f0b8ae7645c492e405e67

+ 23
- 0
build/CopyFNALibs.targets View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Content Include="..\fnalibs\x86\**\*.*" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true' AND '$(Platform)' != 'x64'">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\fnalibs\x64\**\*.*" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true' AND '$(Platform)' != 'x86'">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\fnalibs\osx\**\*.*" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'" >
<Link>osx\%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\fnalibs\lib64\**\*.*" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'" >
<Link>lib64\%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

+ 1
- 0
encompass-cs

@ -0,0 +1 @@
Subproject commit 73ea4568ab277493c6717fa004cf19f9b7aae449

Loading…
Cancel
Save