Rename Dagger to Voile.

This commit is contained in:
2024-02-06 19:25:36 +01:00
parent 9ec3dcfcca
commit 255545cb71
76 changed files with 158 additions and 158 deletions

8
.gitignore vendored
View File

@@ -36,13 +36,13 @@ msbuild.wrn
# Visual Studio 2015
.vs/
# Dagger log files
# Voile log files
*.log
# FMOD binaries (I cannot distribute them)
DaggerFramework.Fmod/*.nupkg
DaggerFramework.Fmod/runtimes/**/*.dll
DaggerFramework.Fmod/runtimes/**/*.so*
Voile.Fmod/*.nupkg
Voile.Fmod/runtimes/**/*.dll
Voile.Fmod/runtimes/**/*.so*
# !binaries/fmod/windows/WINDOWS_BINARIES_HERE
# !binaries/fmod/linux/LINUX_BINARIES_HERE

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="FMOD Local" value=".\DaggerFramework.Fmod" />
<add key="FMOD Local" value=".\Voile.Fmod" />
</packageSources>
</configuration>
</configuration>

View File

@@ -1,4 +1,4 @@
# Dagger Framework
# Voile
A work in progress game framework written in C#.
## Features

View File

@@ -1,7 +1,7 @@
using DaggerFramework.Rendering;
using DaggerFramework.SceneGraph;
using Voile.Rendering;
using Voile.SceneGraph;
namespace DaggerFramework;
namespace Voile;
public class Circle2d : Drawable2d
{

View File

@@ -1,11 +1,11 @@
using System.Numerics;
using DaggerFramework;
using DaggerFramework.Rendering;
using DaggerFramework.Audio;
using DaggerFramework.Resources;
using DaggerFramework.SceneGraph;
using DaggerFramework.Utils;
using Voile;
using Voile.Rendering;
using Voile.Audio;
using Voile.Resources;
using Voile.SceneGraph;
using Voile.Utils;
public class TestGame : Game

View File

@@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../DaggerFramework/DaggerFramework.csproj" />
<ProjectReference Include="../Voile/Voile.csproj" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,7 +1,7 @@
using DaggerFramework;
using DaggerFramework.Extensions;
using DaggerFramework.SceneGraph;
using DaggerFramework.Utils;
using Voile;
using Voile.Extensions;
using Voile.SceneGraph;
using Voile.Utils;
public class TestPlayer : RectangleShape2d
{

View File

@@ -1,9 +1,9 @@
using System.Numerics;
using DaggerFramework;
using DaggerFramework.Rendering;
using DaggerFramework.SceneGraph;
using DaggerFramework.UI;
using DaggerFramework.Utils;
using Voile;
using Voile.Rendering;
using Voile.SceneGraph;
using Voile.UI;
using Voile.Utils;
public class UiLayer : Layer
{

View File

@@ -1,7 +1,7 @@
using System.Numerics;
using DaggerFramework;
using DaggerFramework.Rendering;
using DaggerFramework.SceneGraph;
using Voile;
using Voile.Rendering;
using Voile.SceneGraph;
public class World : Drawable2d
{

View File

@@ -17,4 +17,4 @@
</Content>
</ItemGroup>
</Project>
</Project>

View File

@@ -1,34 +1,34 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestGame", "TestGame\TestGame.csproj", "{393AA04F-A0DE-42F2-AAEC-6B2DCFB7A852}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DaggerFramework", "DaggerFramework\DaggerFramework.csproj", "{DA4FDEDC-AA81-4336-844F-562F9E763974}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Folder", "Solution Folder", "{EE70E84B-A471-4B5B-AE5B-B2712E6553EB}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{393AA04F-A0DE-42F2-AAEC-6B2DCFB7A852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{393AA04F-A0DE-42F2-AAEC-6B2DCFB7A852}.Debug|Any CPU.Build.0 = Debug|Any CPU
{393AA04F-A0DE-42F2-AAEC-6B2DCFB7A852}.Release|Any CPU.ActiveCfg = Release|Any CPU
{393AA04F-A0DE-42F2-AAEC-6B2DCFB7A852}.Release|Any CPU.Build.0 = Release|Any CPU
{DA4FDEDC-AA81-4336-844F-562F9E763974}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA4FDEDC-AA81-4336-844F-562F9E763974}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA4FDEDC-AA81-4336-844F-562F9E763974}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA4FDEDC-AA81-4336-844F-562F9E763974}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestGame", "TestGame\TestGame.csproj", "{393AA04F-A0DE-42F2-AAEC-6B2DCFB7A852}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Voile", "Voile\Voile.csproj", "{DA4FDEDC-AA81-4336-844F-562F9E763974}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Folder", "Solution Folder", "{EE70E84B-A471-4B5B-AE5B-B2712E6553EB}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{393AA04F-A0DE-42F2-AAEC-6B2DCFB7A852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{393AA04F-A0DE-42F2-AAEC-6B2DCFB7A852}.Debug|Any CPU.Build.0 = Debug|Any CPU
{393AA04F-A0DE-42F2-AAEC-6B2DCFB7A852}.Release|Any CPU.ActiveCfg = Release|Any CPU
{393AA04F-A0DE-42F2-AAEC-6B2DCFB7A852}.Release|Any CPU.Build.0 = Release|Any CPU
{DA4FDEDC-AA81-4336-844F-562F9E763974}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA4FDEDC-AA81-4336-844F-562F9E763974}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA4FDEDC-AA81-4336-844F-562F9E763974}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA4FDEDC-AA81-4336-844F-562F9E763974}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework.Audio
namespace Voile.Audio
{
public abstract class AudioBackend : IDisposable
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework
namespace Voile
{
public class AudioBus
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework
namespace Voile
{
public class AudioEffect { }

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework.Audio
namespace Voile.Audio
{
public class DummyAudioBackend : AudioBackend
{

View File

@@ -1,7 +1,7 @@
using FMOD;
using System.Runtime.InteropServices;
namespace DaggerFramework.Audio
namespace Voile.Audio
{
public class FmodAudioBackend : AudioBackend
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework.Audio
namespace Voile.Audio
{
public class SoundInstance
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework
namespace Voile
{
// Based on https://github.com/ppr-game/PPR/blob/engine/PER.Util/src/Color.cs
/// <summary>

View File

@@ -1,6 +1,6 @@
using System.Numerics;
namespace DaggerFramework.Extensions
namespace Voile.Extensions
{
public static class Mat4Extensions
{

View File

@@ -1,6 +1,6 @@
using System.Numerics;
namespace DaggerFramework.Extensions
namespace Voile.Extensions
{
public static class Vector2Extensions
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework
namespace Voile
{
public abstract class Game
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework
namespace Voile
{
public abstract class InputAction
{

View File

@@ -1,8 +1,8 @@
using System.Diagnostics.CodeAnalysis;
using System.Numerics;
using DaggerFramework.Utils;
using Voile.Utils;
namespace DaggerFramework
namespace Voile
{
public abstract class InputHandler
{

View File

@@ -1,7 +1,7 @@
using System.Numerics;
using Raylib_cs;
namespace DaggerFramework
namespace Voile
{
public class RaylibInputHandler : InputHandler
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework.Rendering
namespace Voile.Rendering
{
public class ColorRectShader : Shader
{

View File

@@ -3,7 +3,7 @@ using System.Runtime.InteropServices;
using System.Text;
using Raylib_cs;
namespace DaggerFramework.Rendering
namespace Voile.Rendering
{
public class RaylibRenderer : Renderer
{
@@ -110,7 +110,7 @@ namespace DaggerFramework.Rendering
public override void ClearBackground(Color color)
{
Raylib.ClearBackground(DaggerColorToRaylibColor(color));
Raylib.ClearBackground(VoileColorToRaylibColor(color));
}
protected override double GetFrameTime()
@@ -120,7 +120,7 @@ namespace DaggerFramework.Rendering
public override void DrawCircle(float radius, Color color)
{
Raylib.DrawCircle((int)transformPosition.X, (int)transformPosition.Y, radius, DaggerColorToRaylibColor(color));
Raylib.DrawCircle((int)transformPosition.X, (int)transformPosition.Y, radius, VoileColorToRaylibColor(color));
}
public override void DrawTexture(Texture2d texture, Color tint)
@@ -130,7 +130,7 @@ namespace DaggerFramework.Rendering
LoadTexture(texture);
}
Raylib.DrawTextureV(_texturePool[texture.Handle], transformPosition, DaggerColorToRaylibColor(tint));
Raylib.DrawTextureV(_texturePool[texture.Handle], transformPosition, VoileColorToRaylibColor(tint));
}
public override void DrawRectangle(Vector2 size, Color color)
@@ -141,12 +141,12 @@ namespace DaggerFramework.Rendering
y = transformPosition.Y,
width = size.X,
height = size.Y
}, transformOffset, transformRotation, DaggerColorToRaylibColor(color));
}, transformOffset, transformRotation, VoileColorToRaylibColor(color));
}
public override void DrawDebugText(string text, int fontSize, Color color)
{
Raylib.DrawText(text, (int)transformPosition.X, (int)transformPosition.Y, fontSize, DaggerColorToRaylibColor(color));
Raylib.DrawText(text, (int)transformPosition.X, (int)transformPosition.Y, fontSize, VoileColorToRaylibColor(color));
}
public override void DrawSdfText(string text, int fontSize, Color color)
@@ -199,7 +199,7 @@ namespace DaggerFramework.Rendering
CreateWindow(windowSettings);
}
private Raylib_cs.Color DaggerColorToRaylibColor(Color color)
private Raylib_cs.Color VoileColorToRaylibColor(Color color)
{
return new Raylib_cs.Color { r = (byte)Math.Round(color.R * 255f), g = (byte)Math.Round(color.G * 255f), b = (byte)Math.Round(color.B * 255f), a = (byte)Math.Round(color.A * 255f) };
}
@@ -212,7 +212,7 @@ namespace DaggerFramework.Rendering
}
var rayFont = _fontPool[font.Handle];
Raylib.DrawTextPro(rayFont, text, transformPosition, transformOffset, transformRotation, font.Size, 0.0f, DaggerColorToRaylibColor(color));
Raylib.DrawTextPro(rayFont, text, transformPosition, transformOffset, transformRotation, font.Size, 0.0f, VoileColorToRaylibColor(color));
}
protected override int GetMonitorWidth(int monitorId)

View File

@@ -1,6 +1,6 @@
using System.Numerics;
namespace DaggerFramework.Rendering
namespace Voile.Rendering
{
/// <summary>
/// An abstract class representing the graphics renderer.

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework.Rendering
namespace Voile.Rendering
{
public abstract class Shader
{

View File

@@ -4,7 +4,7 @@ using System.Numerics;
using Silk.NET.GLFW;
using Silk.NET.OpenGL;
namespace DaggerFramework.Rendering
namespace Voile.Rendering
{
/// <summary>
/// A standard, OpenGL-based renderer.

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework;
namespace Voile;
public class Font : Resource
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework.Resources;
namespace Voile.Resources;
public class FontLoader : IResourceLoader<Font>
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework.Resources
namespace Voile.Resources
{
public interface IResourceLoader<T> where T : Resource
{

View File

@@ -1,6 +1,6 @@
using StbVorbisSharp;
namespace DaggerFramework.Resources
namespace Voile.Resources
{
public class SoundLoader : IResourceLoader<Sound>
{

View File

@@ -1,7 +1,7 @@
using DaggerFramework.Resources;
using Voile.Resources;
using StbImageSharp;
namespace DaggerFramework
namespace Voile
{
public class Texture2dLoader : IResourceLoader<Texture2d>
{

View File

@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;
namespace DaggerFramework
namespace Voile
{
public abstract class Resource : IDisposable
{

View File

@@ -1,9 +1,9 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using DaggerFramework.Utils;
using Voile.Utils;
namespace DaggerFramework.Resources
namespace Voile.Resources
{
public class ResourceManager
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework.Resources
namespace Voile.Resources
{
public interface IResourceSaver<T> where T : Resource
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework
namespace Voile
{
public class Sound : Resource
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework
namespace Voile
{
public class Texture2d : Resource
{

View File

@@ -1,6 +1,6 @@
using System.Numerics;
namespace DaggerFramework.SceneGraph;
namespace Voile.SceneGraph;
public class Camera2d : Entity2d
{

View File

@@ -1,6 +1,6 @@
using DaggerFramework.Rendering;
using Voile.Rendering;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public class CircleShape2d : Drawable2d
{

View File

@@ -1,7 +1,7 @@
using System.Numerics;
using DaggerFramework.Rendering;
using Voile.Rendering;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public abstract class Drawable2d : Entity2d, IDrawable
{

View File

@@ -1,8 +1,8 @@
using System.Text.Json.Serialization;
using DaggerFramework.Audio;
using DaggerFramework.Rendering;
using Voile.Audio;
using Voile.Rendering;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public class Entity
{

View File

@@ -1,6 +1,6 @@
using System.Numerics;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public class Entity2d : Entity
{

View File

@@ -1,6 +1,6 @@
using DaggerFramework.Rendering;
using Voile.Rendering;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public interface IDrawable
{

View File

@@ -1,8 +1,8 @@
using System.Drawing;
using System.Numerics;
using DaggerFramework.Rendering;
using Voile.Rendering;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
// TODO: add oneshot parameter.
public class Particles2d : Drawable2d

View File

@@ -1,7 +1,7 @@
using System.Numerics;
using DaggerFramework.Rendering;
using Voile.Rendering;
namespace DaggerFramework.SceneGraph;
namespace Voile.SceneGraph;
public class RectangleShape2d : Drawable2d
{

View File

@@ -1,8 +1,8 @@
using System.Drawing;
using DaggerFramework.Rendering;
using Voile.Rendering;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public class Sprite2d : Drawable2d
{

View File

@@ -1,7 +1,7 @@
using DaggerFramework.Rendering;
using Voile.Rendering;
using System.Drawing;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public class Text2d : Drawable2d
{

View File

@@ -1,8 +1,8 @@
using System.Text.Json.Serialization;
using DaggerFramework.Rendering;
using DaggerFramework.Utils;
using Voile.Rendering;
using Voile.Utils;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public class EntityLayer : Layer
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public interface IMainLoop
{

View File

@@ -1,8 +1,8 @@
using DaggerFramework.Resources;
using DaggerFramework.Rendering;
using Voile.Resources;
using Voile.Rendering;
using System.Text.Json.Serialization;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public abstract class Layer : IDrawable
{

View File

@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public class SerializedScene : Resource
{

View File

@@ -1,7 +1,7 @@
using DaggerFramework.Resources;
using DaggerFramework.Utils;
using Voile.Resources;
using Voile.Utils;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public class SerializedSceneSaver : IResourceSaver<SerializedScene>
{

View File

@@ -1,10 +1,10 @@
using System.Text.Json;
using DaggerFramework.Audio;
using DaggerFramework.Rendering;
using DaggerFramework.Resources;
using Voile.Audio;
using Voile.Rendering;
using Voile.Resources;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public class Scene : IMainLoop
{

View File

@@ -1,7 +1,7 @@
using System.Numerics;
using DaggerFramework.Rendering;
using Voile.Rendering;
namespace DaggerFramework.UI;
namespace Voile.UI;
/// <summary>
/// A basic container for UI elements. All container's children will update their constraints based on container's sizing and positioning.

View File

@@ -1,6 +1,6 @@
using System.Numerics;
namespace DaggerFramework.UI;
namespace Voile.UI;
public class MarginPanel : Panel
{

View File

@@ -1,7 +1,7 @@
using System.Numerics;
using DaggerFramework.Rendering;
using Voile.Rendering;
namespace DaggerFramework.UI;
namespace Voile.UI;
public class Panel : Container
{

View File

@@ -1,4 +1,4 @@
namespace DaggerFramework.UI;
namespace Voile.UI;
public struct PanelStyle
{

View File

@@ -1,6 +1,6 @@
using System.Numerics;
namespace DaggerFramework.UI;
namespace Voile.UI;
public class Rect
{

View File

@@ -1,6 +1,6 @@
using DaggerFramework.Rendering;
using Voile.Rendering;
namespace DaggerFramework.UI;
namespace Voile.UI;
public class TextLabel : UIElement
{

View File

@@ -1,8 +1,8 @@
using System.Numerics;
using DaggerFramework.Rendering;
using DaggerFramework.Utils;
using Voile.Rendering;
using Voile.Utils;
namespace DaggerFramework.UI;
namespace Voile.UI;
public abstract class UIElement
{

View File

@@ -1,6 +1,6 @@
using System.Numerics;
namespace DaggerFramework.UI;
namespace Voile.UI;
public class VerticalPanel : Panel
{

View File

@@ -2,9 +2,9 @@ using System.Numerics;
using ImGuiNET;
using Raylib_cs;
using DaggerFramework.Rendering;
using Voile.Rendering;
namespace DaggerFramework.SceneGraph
namespace Voile.SceneGraph
{
public class ImGuiRenderLayer : Layer
{

View File

@@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
namespace DaggerFramework.Utils
namespace Voile.Utils
{
public class Logger
{
@@ -10,7 +10,7 @@ namespace DaggerFramework.Utils
public static string LogPath { get; set; } = "Logs/";
/// <summary>
/// Maximum amount of log files in a log folder. If it reaches the limit, all logs will be written to <c>dagger-latest.log</c> instead of creating a new one.
/// Maximum amount of log files in a log folder. If it reaches the limit, all logs will be written to <c>voile-latest.log</c> instead of creating a new one.
/// </summary>
public static int MaxLogFiles { get; set; } = 5;
@@ -32,11 +32,11 @@ namespace DaggerFramework.Utils
var dirInfo = Directory.CreateDirectory(LogPath);
var files = dirInfo.GetFiles();
string logName = $"dagger-{DateFormat}-{TimeFormat}.log".Replace(':', '.');
string logName = $"voile-{DateFormat}-{TimeFormat}.log".Replace(':', '.');
if (files.Length >= MaxLogFiles)
{
logName = "dagger-latest.log";
logName = "voile-latest.log";
}
var path = Path.Combine(LogPath, logName);

View File

@@ -1,6 +1,6 @@
using System.Numerics;
namespace DaggerFramework
namespace Voile
{
public static class MathUtils
{

View File

@@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DaggerFramework.Fmod" Version="0.2.2.8" />
<PackageReference Include="Voile.Fmod" Version="0.2.2.8" />
<PackageReference Include="ImGui.NET" Version="1.89.4" />
<PackageReference Include="Raylib-cs" Version="4.2.0.1" />
<PackageReference Include="SharpFont" Version="4.0.1" />
@@ -19,7 +19,7 @@
</ItemGroup>
<Target Name="BuildFmod" BeforeTargets="BeforeBuild">
<MSBuild Projects="../DaggerFramework.Fmod/DaggerFramework.Fmod.csproj" Targets="Restore;Build" />
<MSBuild Projects="../Voile.Fmod/Voile.Fmod.csproj" Targets="Restore;Build" />
</Target>
</Project>