update to latest MoonWorks API

main
cosmonaut 2022-08-29 22:11:51 -07:00
parent a7da12630c
commit 4b1a9feda1
5 changed files with 124 additions and 118 deletions

View File

@ -5,7 +5,7 @@
<TargetName>ProjectName</TargetName>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<LangVersion>8.0</LangVersion>
<LangVersion>7.3</LangVersion>
<StartupObject>ProjectName.Program</StartupObject>
<AssemblyName>ProjectName</AssemblyName>
<RootNamespace>ProjectName</RootNamespace>

View File

@ -10,7 +10,7 @@ NOTE: OSX is broken right now because I need to set up MoltenVK.
- Project boilerplate code
- VSCode build tasks
- VSCode debugger integration
- VSCode step debugger integration
## Requirements
@ -19,6 +19,7 @@ NOTE: OSX is broken right now because I need to set up MoltenVK.
- [Build Tools for Visual Studio 2019](https://visualstudio.microsoft.com/downloads/) on Windows
- [Visual Studio Code](https://code.visualstudio.com/)
- [VSCode C# Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp)
- [VSCode Omnisharp Extension](https://github.com/OmniSharp/omnisharp-vscode)
## Installation
@ -33,7 +34,7 @@ NOTE: OSX is broken right now because I need to set up MoltenVK.
- Open the project directory in VSCode
- Press Ctrl-Shift-B to open the build tasks menu
- Tasks use .NET 6.0 to build and run
- Press F5 to build and debug
- Press F5 to build and run step debugger
## Acknowledgments

View File

@ -25,7 +25,6 @@ function pullMoonWorks()
checkGit
cd lib
git submodule add https://gitea.moonside.games/MoonsideGames/MoonWorks.git
git checkout main
cd ..
echo "Updating to the latest release of MoonWorks..."
git submodule update --init --recursive
@ -42,7 +41,7 @@ function getLibs()
{
# Downloading
echo "Downloading latest moonlibs..."
curl http://moonside.games/files/moonlibs.tar.bz2 > "$MY_DIR/moonlibs.tar.bz2"
curl https://moonside.games/files/moonlibs.tar.bz2 > "$MY_DIR/moonlibs.tar.bz2"
if [ $? -eq 0 ]; then
echo "Finished downloading!"
else
@ -53,7 +52,7 @@ function getLibs()
# Decompressing
echo "Decompressing moonlibs..."
mkdir -p "$MY_DIR"
tar xjC "$MY_DIR" -f "$MY_DIR"/moonlibs.tar.bz2
tar -xvC "$MY_DIR"/moonlibs -f "$MY_DIR"/moonlibs.tar.bz2
if [ $? -eq 0 ]; then
echo "Finished decompressing!"
echo ""
@ -64,8 +63,6 @@ function getLibs()
fi
}
getLibs
read -p "Enter your project name or 'exit' to quit: " newProjectName
if [[ $newProjectName = 'exit' || -z "$newProjectName" ]]; then
exit 1
@ -74,10 +71,12 @@ fi
NEW_PROJECT_DIR="$MY_DIR/../$newProjectName"
if [ -d "$NEW_PROJECT_DIR" ]; then
>&2 echo "ERROR: Directory already exists."
>&2 echo "ERROR: Project directory already exists."
exit 1
fi
getLibs
# copy everything into new dir
cp -R "$MY_DIR" "$NEW_PROJECT_DIR"
@ -98,8 +97,6 @@ rm ./LICENSE
rm -rf .git
git init
git checkout -b main
git branch -D master
mkdir lib
pullMoonWorks

View File

@ -22,9 +22,16 @@ namespace ProjectName
ScreenMode = ScreenMode.Windowed
};
FramerateSettings framerateSettings = new FramerateSettings
{
Mode = FramerateMode.Uncapped,
Cap = 60
};
ProjectNameGame game = new ProjectNameGame(
windowCreateInfo,
MoonWorks.Graphics.PresentMode.FIFORelaxed,
framerateSettings,
true
);

View File

@ -8,8 +8,9 @@ namespace ProjectName
public ProjectNameGame(
WindowCreateInfo windowCreateInfo,
PresentMode presentMode,
FramerateSettings framerateSettings,
bool debugMode
) : base(windowCreateInfo, presentMode, 60, debugMode)
) : base(windowCreateInfo, presentMode, framerateSettings, 60, debugMode)
{
// Insert your game initialization logic here.
}
@ -19,7 +20,7 @@ namespace ProjectName
// Insert your game update logic here.
}
protected override void Draw(System.TimeSpan dt, double alpha)
protected override void Draw(double alpha)
{
// Replace this with your own drawing code.
@ -35,7 +36,7 @@ namespace ProjectName
GraphicsDevice.Submit(commandBuffer);
}
protected override void OnDestroy()
protected override void Destroy()
{
}