merge ImGui branch

This commit is contained in:
Mike 2019-02-18 07:16:08 -08:00
commit bba1d7f59a
16 changed files with 291 additions and 204 deletions

2
.gitignore vendored
View File

@ -1,5 +1,7 @@
.DS_Store
.vs
FNA/
ImGui.NET/
fnalibs/
project_name/bin
project_name/obj

View File

@ -6,6 +6,7 @@
printf "Starting build process...\n"
cd project_name
for file in `find ./Content/** -name "*.fx"` ;
do
# Hush, wine...

View File

@ -8,12 +8,12 @@
"name": "Launch",
"type": "mono",
"request": "launch",
"program": "${workspaceFolder}/bin/Debug/project_name.exe",
"program": "${workspaceFolder}/project_name/bin/Debug/project_name.exe",
"cwd": "${workspaceFolder}",
"preLaunchTask": "Build (Debug)",
"osx":{
"env": {
"DYLD_LIBRARY_PATH": "${workspaceFolder}/bin/Debug/osx/"
"DYLD_LIBRARY_PATH": "${workspaceFolder}/project_name/bin/Debug/osx/"
},
}
},

View File

@ -6,6 +6,8 @@
printf "Starting T4 processing...\n"
cd project_name
# create our output directory
mkdir -p T4Templates/Output

29
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,29 @@
{
// This prevents Omnisharp from prematurely creating obj and bin directories.
// Change this to true after changing the name of the csproj file and running Restore Project.
"omnisharp.autoStart": true,
// This just circumvents annoying default behavior with the C# extension...
// If you really like Code Lens, feel free to change this.
"csharp.referencesCodeLens.enabled": false,
"files.exclude": {
"**/.[^v]*": true, // hide any files that start with a '.' but keep the .vscode folder
".vs": true, // Visual Studio settings
"getFNA.sh": true,
"imgui.ini": true,
"MonoGameContent.targets": true,
"**/obj": true,
"**/bin": true,
".gitignore": true,
".gitmodules": true,
"README.md": true,
"fnalibs": true,
"project_name/CompiledContent/.mgstats": true,
"**/*.csproj*": true,
"**/*.sln": true,
"FNA/[^src]*": true, // hide everything but the src folder
"Nez/{[^DN]*}": true, // hide everything except what begins with D or N
"Nez/Nez.*.*": true, // hide the files in the root of the repo
}
}

View File

@ -12,7 +12,7 @@
{
"label": "Clean Project",
"type": "shell",
"command": "msbuild /t:clean /p:configuration=Debug ; msbuild /t:clean /p:configuration=Release",
"command": "msbuild project_name /t:clean /p:configuration=Debug ; msbuild project_name /t:clean /p:configuration=Release",
"group": "build",
"problemMatcher": "$msCompile",
},
@ -22,6 +22,7 @@
"type": "shell",
"command": "msbuild",
"args": [
"project_name",
"/p:configuration=Debug",
"/t:build"
],
@ -35,6 +36,7 @@
"type": "shell",
"command": "msbuild",
"args": [
"project_name",
"/p:configuration=Release",
"/t:build"
],
@ -47,13 +49,13 @@
"type": "shell",
"group": "build",
"osx":{
"command": "DYLD_LIBRARY_PATH=${workspaceFolder}/bin/Debug/osx/ mono ${workspaceFolder}/bin/Debug/project_name.exe"
"command": "DYLD_LIBRARY_PATH=${workspaceFolder}/project_name/bin/Debug/osx/ mono ${workspaceFolder}/project_name/bin/Debug/project_name.exe"
},
"windows":{
"command": "cmd",
"args": [
"/k",
"${workspaceFolder}/bin/Debug/project_name.exe"
"${workspaceFolder}/project_name/bin/Debug/project_name.exe"
]
},
"dependsOn": "Build (Debug)",
@ -65,13 +67,13 @@
"type": "shell",
"group": "build",
"osx":{
"command": "DYLD_LIBRARY_PATH=${workspaceFolder}/bin/Release/osx/ mono ${workspaceFolder}/bin/Release/project_name.exe"
"command": "DYLD_LIBRARY_PATH=${workspaceFolder}/project_name/bin/Release/osx/ mono ${workspaceFolder}/project_name/bin/Release/project_name.exe"
},
"windows":{
"command": "cmd",
"args": [
"/k",
"${workspaceFolder}/bin/Release/project_name.exe"
"${workspaceFolder}/project_name/bin/Release/project_name.exe"
]
},
"dependsOn": "Build (Release)",
@ -95,9 +97,9 @@
"label": "Build Content",
"type": "shell",
"group": "build",
"command": "mono /Applications/Pipeline.app/Contents/MonoBundle/MGCB.exe /@:Content.mgcb",
"command": "msbuild /t:BuildContent",
"options": {
"cwd": "${workspaceFolder}/CompiledContent"
"cwd": "${workspaceFolder}/project_name"
},
"problemMatcher": "$msCompile"
},
@ -108,7 +110,7 @@
"group": "build",
"command": "mono /Applications/Pipeline.app/Contents/MonoBundle/MGCB.exe /@:Content.mgcb -r",
"options": {
"cwd": "${workspaceFolder}/CompiledContent"
"cwd": "${workspaceFolder}/project_name/CompiledContent"
},
"problemMatcher": "$msCompile"
},
@ -117,7 +119,7 @@
"label": "Open Pipeline Tool",
"type": "shell",
"group": "build",
"command": "export MONOGAME_PIPELINE_PROJECT=${workspaceFolder}/CompiledContent/Content.mgcb && /Applications/Pipeline.app/Contents/MacOS/Pipeline",
"command": "export MONOGAME_PIPELINE_PROJECT=${workspaceFolder}/project_name/CompiledContent/Content.mgcb && /Applications/Pipeline.app/Contents/MacOS/Pipeline",
"problemMatcher": "$msCompile"
},

93
MonoGameContent.targets Normal file
View File

@ -0,0 +1,93 @@
<!--
The main project needs a reference to this project. We use our own instead of the default MonoGame version so we can control
where our content gets built since we don't use "Content" but instead use "CompiledContent"
<Import Project="../MonoGameContent.targets" />
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MonoGameInstallDirectory
Condition=" '$(MonoGameInstallDirectory)' == '' And Exists('/Library/Frameworks/Mono.framework/External/xbuild/MonoGame/v3.0/MonoGame.Common.props') ">/Library/Frameworks/Mono.framework/External/xbuild</MonoGameInstallDirectory>
<MonoGameInstallDirectory
Condition=" '$(MonoGameInstallDirectory)' == '' ">$(MSBuildProgramFiles32)</MonoGameInstallDirectory>
<ContentOutputDir>bin/DesktopGL</ContentOutputDir>
<ContentIntermediateDir>obj/DesktopGL</ContentIntermediateDir>
</PropertyGroup>
<UsingTask TaskName="MonoGame.Build.Tasks.CollectContentReferences"
AssemblyFile="\Library\Frameworks\MonoGame.framework\v3.0\MonoGame.Build.Tasks.dll" />
<!-- Add MonoGameContentReference to item type selection in Visual Studio -->
<ItemGroup>
<AvailableItemName Include="MonoGameContentReference" />
</ItemGroup>
<!-- This disables the IDE feature that skips executing msbuild in some build situations. -->
<PropertyGroup>
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>
<Target Name="Prepare">
<PropertyGroup>
<MonoGameInstallDir>$(MonoGameInstallDirectory)\MonoGame\v3.0\</MonoGameInstallDir>
<!-- El Capitan Support -->
<MonoExe Condition=" '$(OS)' != 'Windows_NT' And Exists ('/Library/Frameworks/Mono.framework/Versions/Current/bin/mono') ">/Library/Frameworks/Mono.framework/Versions/Current/bin/mono</MonoExe>
<MonoExe Condition=" '$(OS)' != 'Windows_NT' And Exists ('/usr/local/bin/mono') ">/usr/local/bin/mono</MonoExe>
<MonoExe Condition=" '$(OS)' != 'Windows_NT' And Exists ('/usr/bin/mono') ">/usr/bin/mono</MonoExe>
<MonoExe Condition=" '$(OS)' != 'Windows_NT' And '$(MonoExe)' == '' ">mono</MonoExe>
<MonoGameContentBuilderExe Condition="'$(MonoGameContentBuilderExe)' == ''">$(MonoGameInstallDir)Tools\MGCB.exe</MonoGameContentBuilderExe>
<MonoGameContentBuilderCmd>"$(MonoGameContentBuilderExe)"</MonoGameContentBuilderCmd>
<MonoGameContentBuilderCmd Condition=" '$(OS)' != 'Windows_NT' ">$(MonoExe) $(MonoGameContentBuilderCmd)</MonoGameContentBuilderCmd>
<PlatformResourcePrefix Condition="'$(MonoGamePlatform)' == 'MacOSX'">$(MonoMacResourcePrefix)</PlatformResourcePrefix>
<PlatformResourcePrefix Condition="'$(MonoGamePlatform)' == 'iOS'">$(IPhoneResourcePrefix)</PlatformResourcePrefix>
<PlatformResourcePrefix Condition="'$(MonoGamePlatform)' == 'Android'">$(MonoAndroidAssetsPrefix)</PlatformResourcePrefix>
<PlatformResourcePrefix Condition="'$(PlatformResourcePrefix)' != '' And !HasTrailingSlash('$(PlatformResourcePrefix)')">$(PlatformResourcePrefix)\</PlatformResourcePrefix>
<PlatformResourcePrefix Condition="'$(PlatformResourcePrefix)' == ''"></PlatformResourcePrefix>
<MonoGameMGCBAdditionalArguments Condition="'$(MonoGameMGCBAdditionalArguments)' ==''">/quiet</MonoGameMGCBAdditionalArguments>
<Header>/platform:$(MonoGamePlatform)</Header>
</PropertyGroup>
<!-- Get all Mono Game Content References and store them in a list -->
<!-- We do this here so we are compatible with xbuild -->
<CollectContentReferences ContentReferences="@(MonoGameContentReference)" MonoGamePlatform="$(MonoGamePlatform)">
<Output TaskParameter="Output" ItemName="ContentReferences" />
</CollectContentReferences>
<Error
Text="The MonoGame content builder executable could not be located at '$(MonoGameContentBuilderExe)'!"
Condition="!Exists('$(MonoGameContentBuilderExe)')"
/>
<Warning
Text="No Content References Found. Please make sure your .mgcb file has a build action of MonoGameContentReference"
Condition=" '%(ContentReferences.FullPath)' == '' "
/>
</Target>
<PropertyGroup>
<BuildDependsOn>
BuildContent;
$(BuildDependsOn);
</BuildDependsOn>
</PropertyGroup>
<Target Name="RunContentBuilder">
<Exec Condition=" '%(ContentReferences.FullPath)' != '' "
Command="$(MonoGameContentBuilderCmd) $(MonoGameMGCBAdditionalArguments) $(Header) /@:&quot;%(ContentReferences.FullPath)&quot; /outputDir:&quot;$(ContentOutputDir)&quot; /intermediateDir:&quot;$(ContentIntermediateDir)&quot;"
WorkingDirectory="%(ContentReferences.RootDir)%(ContentReferences.Directory)" />
<CreateItem Include="%(ContentReferences.RelativeFullPath)%(ContentReferences.ContentOutputDir)\**\*.*"
AdditionalMetadata="ContentOutputDir=%(ContentReferences.ContentDirectory)">
<Output TaskParameter="Include" ItemName="ExtraContent" />
</CreateItem>
</Target>
<Target Name="BuildContent" DependsOnTargets="Prepare;RunContentBuilder" AfterTargets="Build" Condition=" '@(MonoGameContentReference)' != '' "
Outputs="%(ExtraContent.RecursiveDir)%(ExtraContent.Filename)%(ExtraContent.Extension)">
<CreateItem Include="%(ExtraContent.FullPath)" AdditionalMetadata="Link=$(PlatformResourcePrefix)%(ExtraContent.ContentOutputDir)%(ExtraContent.RecursiveDir)%(ExtraContent.Filename)%(ExtraContent.Extension);CopyToOutputDirectory=PreserveNewest"
Condition="'%(ExtraContent.Filename)' != ''">
<Output TaskParameter="Include" ItemName="Content" Condition="'$(MonoGamePlatform)' != 'Android' And '$(MonoGamePlatform)' != 'iOS' And '$(MonoGamePlatform)' != 'MacOSX'" />
<Output TaskParameter="Include" ItemName="BundleResource" Condition="'$(MonoGamePlatform)' == 'MacOSX' Or '$(MonoGamePlatform)' == 'iOS'" />
<Output TaskParameter="Include" ItemName="AndroidAsset" Condition="'$(MonoGamePlatform)' == 'Android'" />
</CreateItem>
</Target>
</Project>

View File

@ -18,10 +18,12 @@ Start new FNA projects with Nez quickly and easily with handy setup scripts, a v
## Setup Instructions ##
1. Download and unzip the ZIP archive (don't clone the repo!)
2. Run `./getFNA.sh` (macOS) to download the latest Nez, FNA and fnalibs to the directory. You can run this script again if you want to update either FNA or the fnalibs at a later point. Nez is setup as a submodule so you can update it in the normal fashion.
3. Open the newly-created and named `PROJECT_NAME_YOU_CHOSE.code-workspace` file (or open the project folder in Visual Studio Code or the top-level sln in Visual Studio)
2. Run `./getFNA.sh` (macOS) to download the latest Nez, FNA and fnalibs to the directory. You can run this script again if you want to update either FNA or the fnalibs at a later point. If you get missing DLL errors when running in Visual Studio copy the FNA libs into your `/usr/local/lib` folder. With Visual Studio Code `DYLD_LIBRARY_PATH` is set automatically so it won't show the DLL not found error. Nez is setup as a submodule so you can update it in the normal fashion.
3. Open the root folder that contains the .sln file in Visual Studio Code or the .sln file directly in Visual Studio
That's it! Now you're ready to build and run the base project. When developing raw content (files not processed by the Pipeline tool) should be placed in the `Content` folder and anything that needs processing should go in the `CompiledContent` folder and added to the Pipeline tool.
That's it! Now you're ready to build and run the base project. When developing, raw content (files not processed by the Pipeline tool) should be placed in the `Content` folder and anything that needs processing should go in the `CompiledContent` folder and added to the Pipeline tool.
The setup process will also init a git repo for you with Nez added as a submodule.
If you want to see the output of `Debug.*` calls in the VS Code Debug Console, you have to install a listener by adding this somewhere in your code (Game1 by default has one for you): `System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(System.Console.Out));`

View File

@ -42,7 +42,7 @@ function downloadFNA()
echo "Downloading FNA..."
git -C $MY_DIR clone https://github.com/FNA-XNA/FNA.git --recursive
if [ $? -eq 0 ]; then
echo "Finished downloading!\n"
echo "Finished downloading!"
else
echo >&2 "ERROR: Unable to download successfully. Maybe try again later?"
fi
@ -55,13 +55,14 @@ function updateFNA()
echo "Updating to the latest git version of FNA..."
git -C "$MY_DIR/FNA" pull --recurse-submodules
if [ $? -eq 0 ]; then
echo "Finished updating!\n"
echo "Finished updating!"
else
echo >&2 "ERROR: Unable to update."
exit 1
fi
}
# Downloads and extracts prepackaged archive of native libraries ("fnalibs")
function getLibs()
{
@ -81,6 +82,7 @@ function getLibs()
tar xjC $MY_DIR/fnalibs -f $MY_DIR/fnalibs.tar.bz2
if [ $? -eq 0 ]; then
echo "Finished decompressing!"
echo ""
rm $MY_DIR/fnalibs.tar.bz2
else
>&2 echo "ERROR: Unable to decompress successfully."
@ -91,25 +93,33 @@ function getLibs()
# Get the directory of this script
MY_DIR=$(dirname "$BASH_SOURCE")
# gather input
# FNA
if [ ! -d "$MY_DIR/FNA" ]; then
read -p "Download FNA (y/n)? " shouldDownload
if [[ $shouldDownload =~ ^[Yy]$ ]]; then
downloadFNA
fi
else
read -p "Update FNA (y/n)? " shouldUpdate
if [[ $shouldUpdate =~ ^[Yy]$ ]]; then
updateFNA
fi
fi
# FNALIBS
if [ ! -d "$MY_DIR/fnalibs" ]; then
read -p "Download fnalibs (y/n)? " shouldDownloadLibs
else
read -p "Redownload fnalibs (y/n)? " shouldDownloadLibs
fi
# act on the input
# FNA
if [[ $shouldDownload =~ ^[Yy]$ ]]; then
downloadFNA
elif [[ $shouldUpdate =~ ^[Yy]$ ]]; then
updateFNA
fi
# FNALIBS
if [[ $shouldDownloadLibs =~ ^[Yy]$ ]]; then
getLibs
fi
@ -119,29 +129,25 @@ fi
installT4
# Rename project
# Only proceed from here if we have not yet renamed the project
if [ ! -d "$MY_DIR/project_name" ]; then
# old project_name folder already renamed so we are all done here
exit 1
fi
read -p "Enter the project name to use for your folder and csproj file or 'exit' to quit: " newProjectName
if [[ $newProjectName = 'exit' || -z "$newProjectName" ]]; then
exit 1
fi
sed -i '' "s/project_name/$newProjectName/g" project_name.code-workspace
sed -i '' "s/project_name/$newProjectName/g" project_name.sln
sed -i '' "s/project_name/$newProjectName/g" .gitignore
sed -i '' "s/project_name/$newProjectName/g" project_name/project_name.sln
sed -i '' "s/project_name/$newProjectName/g" project_name/project_name.csproj
sed -i '' "s/project_name/$newProjectName/g" project_name/Game1.cs
sed -i '' "s/project_name/$newProjectName/g" project_name/Program.cs
sed -i '' "s/project_name/$newProjectName/g" project_name/.vscode/tasks.json
sed -i '' "s/project_name/$newProjectName/g" project_name/.vscode/launch.json
# any files that need to have project_name replaced with the new project name should be here
files=(project_name.sln .gitignore project_name/project_name.csproj project_name/Game1.cs project_name/Program.cs .vscode/tasks.json .vscode/settings.json .vscode/launch.json .vscode/buildEffects.sh .vscode/processT4Templates.sh)
for file in "${files[@]}"; do
sed -i '' "s/project_name/$newProjectName/g" $file
done
mv project_name.code-workspace "$newProjectName.code-workspace"
mv project_name.sln "$newProjectName.sln"
mv project_name/project_name.sln "project_name/$newProjectName.sln"
mv project_name/project_name.csproj "project_name/$newProjectName.csproj"
@ -149,9 +155,17 @@ mv project_name/project_name.csproj.user "project_name/$newProjectName.csproj.us
mv project_name "$newProjectName"
git init
git submodule add git@github.com:prime31/Nez.FNA.git
cd Nez.FNA
git submodule add https://github.com/prime31/Nez.git
cd Nez
git submodule init
git submodule update
printf "\n\nManually run the following command:\n\nnuget restore Nez.FNA/Nez/Nez.sln && msbuild Nez.FNA/Nez/Nez.sln && msbuild /t:restore $newProjectName\n\n"
command -v pbcopy > /dev/null 2>&1
if [ ! $? -eq 0 ]; then
printf "\n\nManually run the following command:\n\nnuget restore Nez/Nez.sln && msbuild Nez/Nez.sln && msbuild /t:restore $newProjectName\n\n"
else
echo "nuget restore Nez/Nez.sln && msbuild Nez/Nez.sln && msbuild /t:restore $newProjectName" | pbcopy
echo ""
echo "A build command was copied to your clipboard. Paste and run it now."
echo ""
fi

View File

@ -1,14 +0,0 @@
{
"folders": [
{
"path": "project_name"
},
{
"path": "Nez.FNA/Nez/Nez.Portable"
}
],
"settings": {
"omnisharp.autoStart": true,
"csharp.referencesCodeLens.enabled": false
}
}

View File

@ -1,52 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D488C5AD-5192-4A08-88FD-22219586ED9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D488C5AD-5192-4A08-88FD-22219586ED9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D488C5AD-5192-4A08-88FD-22219586ED9F}.Debug|x86.ActiveCfg = Debug|x86
{D488C5AD-5192-4A08-88FD-22219586ED9F}.Debug|x86.Build.0 = Debug|x86
{D488C5AD-5192-4A08-88FD-22219586ED9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D488C5AD-5192-4A08-88FD-22219586ED9F}.Release|Any CPU.Build.0 = Release|Any CPU
{D488C5AD-5192-4A08-88FD-22219586ED9F}.Release|x86.ActiveCfg = Release|x86
{D488C5AD-5192-4A08-88FD-22219586ED9F}.Release|x86.Build.0 = Release|x86
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x86.ActiveCfg = Debug|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x86.Build.0 = Debug|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|Any CPU.Build.0 = Release|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x86.ActiveCfg = Release|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x86.Build.0 = Release|Any CPU
{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Debug|Any CPU.ActiveCfg = Debug|x86
{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Debug|Any CPU.Build.0 = Debug|x86
{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Debug|x86.ActiveCfg = Debug|x86
{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Debug|x86.Build.0 = Debug|x86
{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Release|Any CPU.ActiveCfg = Release|x86
{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Release|Any CPU.Build.0 = Release|x86
{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Release|x86.ActiveCfg = Release|x86
{F6DF8289-8138-41C7-B747-E672AFEE44A4}.Release|x86.Build.0 = Release|x86
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project_name", "project_name\project_name.csproj", "{8C576ECC-147D-4B4A-8EC1-56533D26A178}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project_name", "project_name\project_name.csproj", "{3CB9E917-FEF7-453F-A88D-6B85B552B058}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNA", "FNA\FNA.csproj", "{35253CE1-C864-4CD3-8249-4D1319748E8F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nez.FNA", "Nez.FNA\Nez.FNA\Nez.FNA.csproj", "{11A5855C-B12C-4F8D-B935-56F3D0B671C3}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nez.FNA", "Nez\Nez.Portable\Nez.FNA.csproj", "{11A5855C-B12C-4F8D-B935-56F3D0B671C3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nez.FNA.ImGui", "Nez\Nez.ImGui\Nez.FNA.ImGui.csproj", "{16DA6D66-4DFD-46D4-A367-C02B48B80CAA}"
EndProject
Global
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8C576ECC-147D-4B4A-8EC1-56533D26A178}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C576ECC-147D-4B4A-8EC1-56533D26A178}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3CB9E917-FEF7-453F-A88D-6B85B552B058}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3CB9E917-FEF7-453F-A88D-6B85B552B058}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11A5855C-B12C-4F8D-B935-56F3D0B671C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11A5855C-B12C-4F8D-B935-56F3D0B671C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{16DA6D66-4DFD-46D4-A367-C02B48B80CAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{16DA6D66-4DFD-46D4-A367-C02B48B80CAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

View File

@ -1,20 +0,0 @@
{
// This prevents Omnisharp from prematurely creating obj and bin directories.
// Change this to true after changing the name of the csproj file and running Restore Project.
"omnisharp.autoStart": true,
// This just circumvents annoying default behavior with the C# extension...
// If you really like Code Lens, feel free to change this.
"csharp.referencesCodeLens.enabled": false,
"files.exclude": {
"obj": true,
"bin": true,
"CompiledContent/bin": true,
"CompiledContent/obj": true,
"CompiledContent/.mgstats": true,
"*.csproj.user": true,
"*.csproj": true,
"*.sln": true
}
}

View File

@ -1,4 +1,5 @@
using Nez;
using Nez.ImGuiTools;
namespace project_name
{
@ -14,7 +15,8 @@ namespace project_name
#if DEBUG
System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(System.Console.Out));
#endif
// setup a Scene so we have something to show
var newScene = new Scene();
newScene.addRenderer(new DefaultRenderer());
@ -24,6 +26,11 @@ namespace project_name
.addComponent(new Nez.Sprites.Sprite(logo));
scene = newScene;
// optionally render Nez in an ImGui window
var imGuiManager = new ImGuiManager();
Core.registerGlobalManager( imGuiManager );
imGuiManager.setEnabled( true );
}
}
}

View File

@ -49,6 +49,9 @@ namespace Nez
<#+
// all the valid file extensions we should add to the output file
private string[] fileExtensionsToCopy = new string[] { ".xnb", ".png", ".ogg", ".wav", ".fxb" };
// C# reserved keywords
private System.Collections.Generic.List<string> keywords = new System.Collections.Generic.List<string>
{
@ -63,7 +66,7 @@ namespace Nez
void printDirectoryClass( string dir, int depth, string sourceFolder )
{
var dirInfo = new DirectoryInfo( dir );
var firstIndent = new string( ' ', depth * 5 );
var firstIndent = new string( ' ', depth * 4 );
var className = generateClassName( dirInfo.Name, true );
WriteLine( "{0}public static class {1}\n{2}{{", firstIndent, className, firstIndent );
@ -81,10 +84,10 @@ namespace Nez
// prints a const string for each file in the directory
void printContentFiles( string dir, int depth, string sourceFolder )
{
var firstIndent = new string( '\t', depth );
var firstIndent = new string( ' ', depth * 4 );
var files = Directory.EnumerateFiles( dir )
.Where( s => s.EndsWith( ".xnb" ) || s.EndsWith( ".png" ) || s.EndsWith( ".ogg" ) || s.EndsWith( ".wav" ) || s.EndsWith( ".fxb" ) );
.Where( s => Array.IndexOf( fileExtensionsToCopy, Path.GetExtension( s ) ) >= 0 );
foreach( var file in files )
{
// clear out all of the path up to the sourceFolder so we get just the relative path to the Content folder

View File

@ -1,70 +1,87 @@
<?xml version="1.0"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net471</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
<AssemblyName>project_name</AssemblyName>
<MonoGamePlatform>DesktopGL</MonoGamePlatform>
</PropertyGroup>
<!-- Reference FNA project -->
<ItemGroup>
<ProjectReference Include="../FNA/FNA.csproj" />
<ProjectReference Include="../Nez.FNA/Nez.FNA/Nez.FNA.csproj" />
</ItemGroup>
<!-- Include the Content directory (except for .fx files, since we use .fxb at runtime) -->
<ItemGroup>
<Content Include="Content/**/*.*" Exclude="**/*.fx; Content/Content-Goes-Here.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<!-- Include the CompiledContent bin (MGCB output). Copy it to the Content folder in the build. -->
<ItemGroup>
<Content Include="CompiledContent/bin/DesktopGL/**/*.xnb">
<Link>Content/%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<!-- I can't seem to get msbuild to automatically handle content so these next two bits do nothing -->
<ItemGroup>
<MonoGameContentReference Include="CompiledContent\Content.mgcb" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
<PropertyGroup>
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
</PropertyGroup>
<!-- Copy fnalib directories to output -->
<ItemGroup>
<Content Include="..\fnalibs\x86\**\*.*" Condition="'$(OS)' == 'Windows_NT' AND '$(Platform)' != 'x64'">
<Link>x86\%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\fnalibs\x64\**\*.*" Condition="'$(OS)' == 'Windows_NT' AND '$(Platform)' != 'x86'">
<Link>x64\%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\fnalibs\osx\**\*.*" Condition="'$(OS)' != 'Windows_NT' AND $(IsOSX) == 'true'">
<Link>osx\%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\fnalibs\lib\**\*.*" Condition="'$(OS)' != 'Windows_NT' AND $(IsLinux) == 'true'">
<Link>lib\%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\fnalibs\lib64\**\*.*" Condition="'$(OS)' != 'Windows_NT' AND $(IsLinux) == 'true'">
<Link>lib64\%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net471</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
<AssemblyName>project_name</AssemblyName>
<MonoGamePlatform>DesktopGL</MonoGamePlatform>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<!-- Reference FNA, Nez and ImGui projects -->
<ItemGroup>
<ProjectReference Include="../FNA/FNA.csproj"/>
<ProjectReference Include="../Nez/Nez.Portable/Nez.FNA.csproj"/>
<ProjectReference Include="../Nez/Nez.ImGui/Nez.FNA.ImGui.csproj"/>
</ItemGroup>
<!-- Includes Nez default effects and textures -->
<ItemGroup>
<Content Include="../Nez/DefaultContent/FNAEffects/**/*.fxb">
<Link>Content/nez/effects/%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="../Nez/DefaultContent/textures/**/*.xnb">
<Link>Content/nez/textures/%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<!-- Include the Content directory (except for .fx files, since we use .fxb at runtime) -->
<ItemGroup>
<Content Include="Content/**/*.*" Exclude="**/*.fx; Content/Content-Goes-Here.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<!-- Include the CompiledContent bin (MGCB output). Copy it to the Content folder in the build. -->
<ItemGroup>
<Content Include="CompiledContent/bin/DesktopGL/**/*.xnb">
<Link>Content/%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<!-- cleanup so VS looks clean -->
<None Remove="CompiledContent\obj\**"/>
<None Remove="CompiledContent\bin\**"/>
<None Remove="CompiledContent\.*"/>
</ItemGroup>
<!-- MonoGames content pipeline needs this defined -->
<ItemGroup>
<MonoGameContentReference Include="CompiledContent\Content.mgcb"/>
</ItemGroup>
<Import Project="../MonoGameContent.targets"/>
<PropertyGroup>
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
</PropertyGroup>
<!-- Copy fnalib directories to output -->
<ItemGroup>
<Content Include="..\fnalibs\x86\**\*.*" Condition="'$(OS)' == 'Windows_NT' AND '$(Platform)' != 'x64'">
<Link>x86\%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\fnalibs\x64\**\*.*" Condition="'$(OS)' == 'Windows_NT' AND '$(Platform)' != 'x86'">
<Link>x64\%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\fnalibs\osx\**\*.*" Condition="'$(OS)' != 'Windows_NT' AND $(IsOSX) == 'true'">
<Link>osx\%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\fnalibs\lib\**\*.*" Condition="'$(OS)' != 'Windows_NT' AND $(IsLinux) == 'true'">
<Link>lib\%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\fnalibs\lib64\**\*.*" Condition="'$(OS)' != 'Windows_NT' AND $(IsLinux) == 'true'">
<Link>lib64\%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

View File

@ -1,24 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project_name", "project_name.csproj", "{BD11109C-8FD1-4FFE-A3EF-8390A1EAE1A1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNA", "../FNA/FNA.csproj", "{35253CE1-C864-4CD3-8249-4D1319748E8F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nez.FNA", "../Nez.FNA/Nez.FNA/Nez.FNA.csproj", "{11A5855C-B12C-4F8D-B935-56F3D0B671C3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nez.PipelineImporter", "../Nez.FNA/Nez/Nez.PipelineImporter/Nez.PipelineImporter.csproj", "{63E831F4-B847-4150-B5AF-CBE059EE27B8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BD11109C-8FD1-4FFE-A3EF-8390A1EAE1A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD11109C-8FD1-4FFE-A3EF-8390A1EAE1A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD11109C-8FD1-4FFE-A3EF-8390A1EAE1A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD11109C-8FD1-4FFE-A3EF-8390A1EAE1A1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal