Skip to content

Commit

Permalink
Moved Fin files again, because I wasn't entirely happy with the new s…
Browse files Browse the repository at this point in the history
…tructure. Now, the audio/graphics libraries have been merged into a single "Fin.Ui" library, which better reflects the fact that these are UI-specific libraries for audio playback and graphics rendering.
  • Loading branch information
MeltyPlayer committed Aug 8, 2023
1 parent 4481996 commit 8e9ef55
Show file tree
Hide file tree
Showing 68 changed files with 85 additions and 103 deletions.
2 changes: 1 addition & 1 deletion FinModelUtility/Ast/Ast/Ast.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Fin\Fin.Audio\Fin.Audio.csproj" />
<ProjectReference Include="..\..\Fin\Fin.Ui\Fin.Ui.csproj" />
<ProjectReference Include="..\..\Fin\Fin\Fin.csproj" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion FinModelUtility/Ast/Ast/src/api/AstAudioLoader.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ast.schema;
using fin.audio;
using fin.ui.audio;
using fin.io;

using schema.binary;
Expand Down
4 changes: 2 additions & 2 deletions FinModelUtility/BanjoKazooie/BanjoKazooie.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\F3dzex2\F3dzex2.csproj" />
<ProjectReference Include="..\..\Fin\Fin\Fin.csproj" />
<ProjectReference Include="..\F3dzex2\F3dzex2.csproj" />
<ProjectReference Include="..\Fin\Fin\Fin.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion FinModelUtility/Fin/Fin Tests/Fin Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0-preview-20211130-02" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Fin.Graphics\Fin.Graphics.csproj" />
<ProjectReference Include="..\Fin.Ui\Fin.Ui.csproj" />
<ProjectReference Include="..\Fin\Fin.csproj" />
<ProjectReference Include="..\..\Asserts\Asserts.csproj" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion FinModelUtility/Fin/Fin Tests/gl/GlTransformTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;

namespace fin.graphics.gl {
namespace fin.ui.graphics.gl {
public class GlTransformTests {
[Test]
public void CrossProduct() {
Expand Down
16 changes: 0 additions & 16 deletions FinModelUtility/Fin/Fin.Graphics/Fin.Graphics.csproj

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>fin.audio</RootNamespace>
<RootNamespace>fin.ui</RootNamespace>
<LangVersion>preview</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using fin.io.bundles;


namespace fin.audio {
namespace fin.ui.audio {
public interface IAudioFileBundle : IFileBundle { }

public interface IAudioLoader<in TAudioFileBundle>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Numerics;


namespace fin.audio {
namespace fin.ui.audio {
public interface IAudioManager<TNumber> : IDisposable
where TNumber : INumber<TNumber> {
// TODO: Add support for looping a certain section of audio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using NVorbis;


namespace fin.audio {
namespace fin.ui.audio {
public class OggAudioFileBundle : IAudioFileBundle {
public OggAudioFileBundle(IFileHierarchyFile oggFile) {
this.OggFile = oggFile;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using OpenTK.Audio;


namespace fin.audio.al {
namespace fin.ui.audio.al {
public partial class AlAudioManager : IAudioManager<short> {
private readonly AudioContext context_ = new();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace fin.audio.al {
namespace fin.ui.audio.al {
public partial class AlAudioManager {
public IAudioSource<short> CreateAudioSource() => new AlAudioSource(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using OpenTK.Audio.OpenAL;


namespace fin.audio.al {
namespace fin.ui.audio.al {
public partial class AlAudioManager {
private partial class AlAudioSource : IAudioSource<short> {
public IActiveMusic<short> CreateMusic(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using OpenTK.Audio.OpenAL;


namespace fin.audio.al {
namespace fin.ui.audio.al {
public partial class AlAudioManager {
private partial class AlAudioSource {
public IActiveSound<short> Create(IAudioBuffer<short> buffer)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace fin.audio.al {
namespace fin.ui.audio.al {
public partial class AlAudioManager {
public IBufferAudioStream<short> CreateBufferAudioStream(
IAudioBuffer<short> buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using OpenTK.Audio.OpenAL;


namespace fin.audio.al {
namespace fin.ui.audio.al {
public partial class AlAudioManager {
public ICircularQueueActiveSound<short> CreateBufferedSound(
AudioChannelsType audioChannelsType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System;


namespace fin.audio.al {
namespace fin.ui.audio.al {
public partial class AlAudioManager {
public IMutableAudioBuffer<short> CreateMutableBuffer()
=> new AlMutableAudioBuffer();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace fin.graphics {
namespace fin.ui.graphics {
public interface IRenderable {
void Render();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using PrimitiveType = fin.model.PrimitiveType;


namespace fin.graphics.gl {
namespace fin.ui.graphics.gl {
public class GlBufferManager : IDisposable {
private class VertexArrayObject : IDisposable {
private const int POSITION_SIZE_ = 3;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using OpenTK.Graphics.OpenGL;


namespace fin.graphics.gl {
namespace fin.ui.graphics.gl {
public class GlDisplayList : IDisposable {
private readonly int displayListId_;
private bool valid_ = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using OpenTK.Graphics.OpenGL;


namespace fin.graphics.gl {
namespace fin.ui.graphics.gl {
public class GlShaderProgram : IDisposable {
private readonly CachedShaderProgram cachedShaderProgram_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using TextureMinFilter = OpenTK.Graphics.OpenGL.TextureMinFilter;


namespace fin.graphics.gl {
namespace fin.ui.graphics.gl {
public class GlTexture : IDisposable {
private static readonly Dictionary<ITexture, GlTexture> cache_ = new();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

using GlMatrixMode = OpenTK.Graphics.OpenGL.MatrixMode;

namespace fin.graphics.gl {
namespace fin.ui.graphics.gl {
public static class GlTransform {
private static readonly Matrix4x4Stack modelViewMatrix_ = new();
private static readonly Matrix4x4Stack projectionMatrix_ = new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Matrix4x4 = System.Numerics.Matrix4x4;


namespace fin.graphics.gl.material {
namespace fin.ui.graphics.gl.material {
public abstract class BGlMaterialShader<TMaterial> : IGlMaterialShader
where TMaterial : IReadOnlyMaterial {
private readonly IModel model_;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace fin.graphics.gl.material {
namespace fin.ui.graphics.gl.material {
public static class CommonShaderPrograms {
private static GlShaderProgram? texturelessShaderProgram_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using OpenTK.Graphics.OpenGL;


namespace fin.graphics.gl.material {
namespace fin.ui.graphics.gl.material {
public class GlFixedFunctionMaterialShaderV2
: BGlMaterialShader<IReadOnlyFixedFunctionMaterial> {
private int[] textureLocations_ =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using fin.image;


namespace fin.graphics.gl.material {
namespace fin.ui.graphics.gl.material {
public static class GlMaterialConstants {
public static GlTexture NULL_WHITE_TEXTURE;
public static GlTexture NULL_GRAY_TEXTURE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using fin.model;


namespace fin.graphics.gl.material {
namespace fin.ui.graphics.gl.material {
public static class GlMaterialShader {
public static IGlMaterialShader FromMaterial(
IModel model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using fin.shaders.glsl;


namespace fin.graphics.gl.material {
namespace fin.ui.graphics.gl.material {
public class GlNullMaterialShaderV2 : BGlMaterialShader<IReadOnlyMaterial?> {
public GlNullMaterialShaderV2(
IModel model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using fin.model.util;


namespace fin.graphics.gl.material {
namespace fin.ui.graphics.gl.material {
public class GlSimpleMaterialShaderV2 : BGlMaterialShader<IReadOnlyMaterial> {
private readonly GlTexture primaryGlTexture_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using OpenTK.Graphics.OpenGL;


namespace fin.graphics.gl.material {
namespace fin.ui.graphics.gl.material {
public class GlStandardMaterialShaderV2
: BGlMaterialShader<IStandardMaterial> {
private GlTexture diffuseTexture_;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using fin.model;


namespace fin.graphics.gl.material {
namespace fin.ui.graphics.gl.material {
public interface IGlMaterialShader : IDisposable {
IReadOnlyMaterial Material { get; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using fin.model;


namespace fin.graphics.gl.model {
namespace fin.ui.graphics.gl.model {
public interface IModelRenderer : IRenderable, IDisposable {
IModel Model { get; }
ISet<IMesh> HiddenMeshes { get; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using fin.model;

using fin.graphics.gl.material;
using fin.math;
using fin.ui.graphics.gl.material;

using PrimitiveType = fin.model.PrimitiveType;


namespace fin.graphics.gl.model {
namespace fin.ui.graphics.gl.model {
public class MaterialMeshRendererV2 : IDisposable {
// TODO: Set up shader for material
// TODO: Use material's textures
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using fin.model;


namespace fin.graphics.gl.model {
namespace fin.ui.graphics.gl.model {
/// <summary>
/// A renderer for a Fin model.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using PrimitiveType = OpenTK.Graphics.OpenGL.PrimitiveType;


namespace fin.graphics.gl.model {
namespace fin.ui.graphics.gl.model {
public interface ISkeletonRenderer : IRenderable {
ISkeleton Skeleton { get; }
IBone? SelectedBone { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using fin.scene;

namespace fin.graphics.gl.scene {
namespace fin.ui.graphics.gl.scene {
public class SceneAreaRenderer : IRenderable, IDisposable {
public SceneAreaRenderer(ISceneArea sceneArea) {
var customSkybox = sceneArea.CustomSkyboxObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System.Numerics;

using fin.config;
using fin.graphics.gl.material;
using fin.graphics.gl.model;
using fin.math.matrix;
using fin.model;
using fin.scene;
using fin.ui;
using fin.ui.graphics.gl.material;
using fin.ui.graphics.gl.model;

namespace fin.graphics.gl.scene {
namespace fin.ui.graphics.gl.scene {
public class SceneModelRenderer : IRenderable, IDisposable {
private readonly ISceneModel sceneModel_;
private readonly IModelRenderer modelRenderer_;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using fin.math.matrix;
using fin.scene;

namespace fin.graphics.gl.scene {
namespace fin.ui.graphics.gl.scene {
public class SceneObjectRenderer : IRenderable, IDisposable {
private readonly ISceneObject sceneObject_;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using fin.scene;

namespace fin.graphics.gl.scene {
namespace fin.ui.graphics.gl.scene {
public class SceneRenderer : IRenderable, IDisposable {
public SceneRenderer(IScene scene) {
this.AreaRenderers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using OpenTK.Graphics.OpenGL;


namespace fin.graphics.gl {
namespace fin.ui.graphics.gl {
public static partial class GlUtil {
public static bool IsInitialized { get; private set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using GlLogicOp = OpenTK.Graphics.OpenGL.LogicOp;


namespace fin.graphics.gl {
namespace fin.ui.graphics.gl {
public partial class GlState {
public (BlendMode, BlendFactor, BlendFactor, FinLogicOp)
CurrentBlending { get; set; } = (BlendMode.ADD, BlendFactor.SRC_ALPHA,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using OpenTK.Graphics.OpenGL;


namespace fin.graphics.gl {
namespace fin.ui.graphics.gl {
public partial class GlState {
public Color ClearColor { get; set; }
}
Expand Down
Loading

0 comments on commit 8e9ef55

Please sign in to comment.