From b2a1c6037272e82470bf156d595729559f9d59fd Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 12 Feb 2019 22:48:11 -0800 Subject: [PATCH] make slick the install process --- .gitignore | 1 + getFNA.sh | 44 ++++++++++++------- project_name/Game1.cs | 6 ++- .../ImGui/ImGuiFinalRenderDelegate.cs | 2 +- 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index bf09f5c..5694e90 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store +.vs FNA/ ImGui.NET/ fnalibs/ diff --git a/getFNA.sh b/getFNA.sh index ba85897..55395fe 100755 --- a/getFNA.sh +++ b/getFNA.sh @@ -122,40 +122,50 @@ 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 + + +# Dear ImGui +if [ ! -d "$MY_DIR/ImGui.NET" ]; then + read -p "Download ImGui.NET (y/n)? " shouldDownload +else + read -p "Update ImGui.NET (y/n)? " shouldUpdate +fi + + +# act on the input + +# FNA +if [[ $shouldDownload =~ ^[Yy]$ ]]; then + downloadFNA +elif [[ $shouldUpdate =~ ^[Yy]$ ]]; then + updateFNA +fi + +# FNALIBS if [[ $shouldDownloadLibs =~ ^[Yy]$ ]]; then getLibs fi # Dear ImGui -if [ ! -d "$MY_DIR/ImGui.NET" ]; then - read -p "Download ImGui.NET (y/n)? " shouldDownload - if [[ $shouldDownload =~ ^[Yy]$ ]]; then - downloadImGui - fi -else - read -p "Update ImGui.NET (y/n)? " shouldUpdate - if [[ $shouldUpdate =~ ^[Yy]$ ]]; then - updateImGui - fi +if [[ $shouldDownload =~ ^[Yy]$ ]]; then + downloadImGui +elif [[ $shouldUpdate =~ ^[Yy]$ ]]; then + updateImGui fi diff --git a/project_name/Game1.cs b/project_name/Game1.cs index a5a2783..45d22e3 100644 --- a/project_name/Game1.cs +++ b/project_name/Game1.cs @@ -14,9 +14,13 @@ 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()); + + // optionally render Nez in an ImGui window + newScene.finalRenderDelegate = new ImGuiFinalRenderDelegate(); var logo = newScene.content.Load("nez-logo-black"); newScene.createEntity("logo") diff --git a/project_name/ImGui/ImGuiFinalRenderDelegate.cs b/project_name/ImGui/ImGuiFinalRenderDelegate.cs index 29510c7..678be53 100644 --- a/project_name/ImGui/ImGuiFinalRenderDelegate.cs +++ b/project_name/ImGui/ImGuiFinalRenderDelegate.cs @@ -39,7 +39,7 @@ namespace Nez Core.graphicsDevice.Clear( letterboxColor ); - _imGuiRenderer.BeforeLayout(new GameTime(TimeSpan.FromDays(0), TimeSpan.FromMilliseconds(Time.deltaTime * 1000))); + _imGuiRenderer.BeforeLayout(Time.time); layoutGui(); _imGuiRenderer.AfterLayout(); }