From 261a3be02d8baa335ea49193c3e7b11990b5d57b Mon Sep 17 00:00:00 2001 From: Michel Fedde Date: Sat, 20 Mar 2021 10:22:30 +0100 Subject: [PATCH] Updated gitignore; Removed MigrationBackup and Legacy --- .gitignore | 1 + Legacy/Window/Contexts/DrawContext.cs | 103 ------ Legacy/Window/Contexts/UpdateContext.cs | 32 -- Legacy/Window/GLWPFWindow2D.cs | 48 --- Legacy/Window/GLWindow2D.cs | 65 ---- Legacy/Window/GenericWPFWindow.cs | 106 ------- Legacy/Window/GenericWindow.cs | 296 ------------------ Legacy/Window/GenericWindowCode.cs | 107 ------- Legacy/Window/IGLWindow2D.cs | 14 - Legacy/Window/IGenericWindow.cs | 37 --- Legacy/Window/RenderPipeline.cs | 150 --------- .../SMRenderer/SM2D/NuGetUpgradeLog.html | 162 ---------- .../d4ed0f1f/SMRenderer/SM2D/SM2D.csproj | 82 ----- .../d4ed0f1f/SMRenderer/SM2D/packages.config | 4 - 14 files changed, 1 insertion(+), 1206 deletions(-) delete mode 100644 Legacy/Window/Contexts/DrawContext.cs delete mode 100644 Legacy/Window/Contexts/UpdateContext.cs delete mode 100644 Legacy/Window/GLWPFWindow2D.cs delete mode 100644 Legacy/Window/GLWindow2D.cs delete mode 100644 Legacy/Window/GenericWPFWindow.cs delete mode 100644 Legacy/Window/GenericWindow.cs delete mode 100644 Legacy/Window/GenericWindowCode.cs delete mode 100644 Legacy/Window/IGLWindow2D.cs delete mode 100644 Legacy/Window/IGenericWindow.cs delete mode 100644 Legacy/Window/RenderPipeline.cs delete mode 100644 MigrationBackup/d4ed0f1f/SMRenderer/SM2D/NuGetUpgradeLog.html delete mode 100644 MigrationBackup/d4ed0f1f/SMRenderer/SM2D/SM2D.csproj delete mode 100644 MigrationBackup/d4ed0f1f/SMRenderer/SM2D/packages.config diff --git a/.gitignore b/.gitignore index 5d68136..76f1e51 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ # Dev-Added files *.nuspec */*/nuget.exe +**/apireference/** # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs diff --git a/Legacy/Window/Contexts/DrawContext.cs b/Legacy/Window/Contexts/DrawContext.cs deleted file mode 100644 index cb449f5..0000000 --- a/Legacy/Window/Contexts/DrawContext.cs +++ /dev/null @@ -1,103 +0,0 @@ -#region usings - -using System.Collections.Generic; -using System.Dynamic; -using OpenTK; -using SM.Base.Drawing; -using SM.Base.Scene; -using SM.OGL.Mesh; - -#endregion - -namespace SM.Base.Contexts -{ - /// - /// Contains important information for drawing. - /// - public struct DrawContext - { - /// - /// This says if it was forced to use the viewport camera. - /// - public bool ForceViewport; - - /// - /// Contains the currently used render pipeline. - /// - public RenderPipeline ActivePipeline; - - public GenericScene ActiveScene; - public IGenericWindow Window; - - - public GenericCamera UsedCamera => - ForceViewport || ActiveScene._camera == null ? Window.ViewportCamera : ActiveScene._camera; - - - - /// - /// The mesh. - /// - public GenericMesh Mesh; - - /// - /// The material. - /// - public Material Material; - - /// - /// The drawing instances. - /// If there is only one, it's index 0 - /// - public IList Instances; - - - - /// - /// The current world scale. - /// - public Vector2 WorldScale; - - /// - /// The last collection the context was passed though. - /// - public object LastPassthough; - - - - /// - /// Returns the appropriate shader. - /// - /// Returns the material shader, if available, otherwise it will take the default shader from the render - /// pipeline. - /// - /// - public MaterialShader Shader => Material.CustomShader ?? ActivePipeline._defaultShader; - /// - /// Arguments for shaders - /// - public IDictionary ShaderArguments; - - - - /// - /// The current world matrix. - /// - public Matrix4 World; - - /// - /// The current view matrix. - /// - public Matrix4 View; - - /// - /// The current WorldView matrix. - /// - public Matrix4 WorldView; - - /// - /// The master model matrix. - /// - public Matrix4 ModelMaster; - } -} \ No newline at end of file diff --git a/Legacy/Window/Contexts/UpdateContext.cs b/Legacy/Window/Contexts/UpdateContext.cs deleted file mode 100644 index 63eb913..0000000 --- a/Legacy/Window/Contexts/UpdateContext.cs +++ /dev/null @@ -1,32 +0,0 @@ -#region usings - -using OpenTK.Input; -using SM.Base.Scene; - -#endregion - -namespace SM.Base.Contexts -{ - /// - /// The update context. - /// - public struct UpdateContext - { - /// - /// The delta time. - /// - public float Deltatime => SMRenderer.DefaultDeltatime.DeltaTime; - - /// - /// The current keyboard state. - /// - public KeyboardState KeyboardState; - - /// - /// The current mouse state. - /// - public MouseState MouseState; - - public GenericScene CurrentScene; - } -} \ No newline at end of file diff --git a/Legacy/Window/GLWPFWindow2D.cs b/Legacy/Window/GLWPFWindow2D.cs deleted file mode 100644 index f334bac..0000000 --- a/Legacy/Window/GLWPFWindow2D.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Windows.Media; -using OpenTK; -using OpenTK.Graphics.ES11; -using SM.Base; -using SM2D.Controls; -using SM2D.Pipelines; -using SM2D.Scene; -using SM2D.Shader; - -namespace SM2D -{ - public class GLWPFWindow2D : GenericWPFWindow, IGLWindow2D - { - public GLWPFWindow2D() - { - Mouse = new Mouse2D(this); - } - - public Vector2? Scaling { get; set; } - public Mouse2D Mouse { get; } - - protected override void Init() - { - base.Init(); - - SMRenderer.DefaultMaterialShader = Default2DShader.MaterialShader; - - //SetRenderPipeline(Default2DPipeline.Pipeline); - } - - protected override void Rendering(TimeSpan delta) - { - GL.Disable(EnableCap.DepthTest); - base.Rendering(delta); - } - - public override void SetWorldScale() - { - if (Scaling.HasValue) - { - if (Scaling.Value.X > 0 && Scaling.Value.Y > 0) WorldScale = Scaling.Value; - else if (Scaling.Value.X > 0) WorldScale = new Vector2(Scaling.Value.X, Scaling.Value.X / Aspect); - else if (Scaling.Value.Y > 0) WorldScale = new Vector2(Aspect * Scaling.Value.Y, Scaling.Value.Y); - } - } - } -} \ No newline at end of file diff --git a/Legacy/Window/GLWindow2D.cs b/Legacy/Window/GLWindow2D.cs deleted file mode 100644 index dc3924d..0000000 --- a/Legacy/Window/GLWindow2D.cs +++ /dev/null @@ -1,65 +0,0 @@ -#region usings - -using System; -using OpenTK; -using OpenTK.Graphics.OpenGL4; -using OpenTK.Input; -using SM.Base; -using SM2D.Controls; -using SM2D.Pipelines; -using SM2D.Scene; -using SM2D.Shader; - -#endregion - -namespace SM2D -{ - public class GLWindow2D : GenericWindow, IGLWindow2D - { - public GLWindow2D() - { - Mouse = new Mouse2D(this); - } - - public Vector2? Scaling { get; set; } - - public Mouse2D Mouse { get; } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - GL.Enable(EnableCap.Blend); - GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha); - } - - protected override void OnLoaded() - { - base.OnLoaded(); - SMRenderer.DefaultMaterialShader = Default2DShader.MaterialShader; - - SetRenderPipeline(Default2DPipeline.Pipeline); - } - - protected override void OnRenderFrame(FrameEventArgs e) - { - GL.Disable(EnableCap.DepthTest); - base.OnRenderFrame(e); - } - - public override void SetWorldScale() - { - if (Scaling.HasValue) - { - if (Scaling.Value.X > 0 && Scaling.Value.Y > 0) WorldScale = Scaling.Value; - else if (Scaling.Value.X > 0) WorldScale = new Vector2(Scaling.Value.X, Scaling.Value.X / Aspect); - else if (Scaling.Value.Y > 0) WorldScale = new Vector2(Aspect * Scaling.Value.Y, Scaling.Value.Y); - } - } - - protected override void OnMouseMove(MouseMoveEventArgs e) - { - base.OnMouseMove(e); - Mouse.MouseMoveEvent(e); - } - } -} \ No newline at end of file diff --git a/Legacy/Window/GenericWPFWindow.cs b/Legacy/Window/GenericWPFWindow.cs deleted file mode 100644 index f36ff3b..0000000 --- a/Legacy/Window/GenericWPFWindow.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System; -using System.Drawing; -using System.Windows; -using System.Windows.Media; -using OpenTK; -using OpenTK.Wpf; -using SM.Base.Scene; -using SM.OGL; - -namespace SM.Base -{ - public class GenericWPFWindow : OpenTK.Wpf.GLWpfControl, IGenericWindow - { - protected GenericCamera _viewportCamera; - - public bool Loading => !base.IsInitialized; - public float Aspect { get; set; } - public GenericCamera ViewportCamera => _viewportCamera; - public bool ForceViewportCamera { get; set; } - public int Width => (int) base.ActualWidth; - public int Height => (int) base.ActualHeight; - public Rectangle ClientRectangle => new Rectangle((int)base.RenderTransformOrigin.X, (int)RenderTransformOrigin.Y, Width, Height); - public Vector2 WorldScale { get; set; } - - public GenericWPFWindow() - { - - Ready += Init; - Render += Rendering; - } - - protected virtual void Init() - { - GenericWindowCode.Load(this); - } - - protected virtual void Rendering(TimeSpan delta) - { - - } - - protected override void OnRenderSizeChanged(SizeChangedInfo info) - { - base.OnRenderSizeChanged(info); - - GenericWindowCode.Resize(this); - } - - public void Start(bool renderContinuesly = false) - { - GLWpfControlSettings settings = new GLWpfControlSettings() - { - MajorVersion = GLSettings.ForcedVersion.MajorVersion, - MinorVersion = GLSettings.ForcedVersion.MinorVersion, - RenderContinuously = renderContinuesly - }; - base.Start(settings); - } - - public virtual void SetWorldScale() - { } - } - - public class GenericWPFWindow : GenericWPFWindow, IGenericWindow - where TScene : GenericScene, new() - where TCamera : GenericCamera, new() - { - private TScene _scene; - private RenderPipeline _renderPipeline; - - public TScene CurrentScene => _scene; - public RenderPipeline RenderPipeline => _renderPipeline; - - public GenericWPFWindow() : base() - { - _viewportCamera = new TCamera(); - } - - protected override void Rendering(TimeSpan delta) - { - base.Rendering(delta); - - GenericWindowCode.Render(this, (float)delta.TotalSeconds); - } - - protected override void OnRenderSizeChanged(SizeChangedInfo info) - { - base.OnRenderSizeChanged(info); - - GenericWindowCode.Resize(this); - } - - public void SetScene(TScene scene) - { - _scene = scene; - scene.Activate(); - RenderPipeline?.SceneChanged(scene); - } - - public void SetRenderPipeline(RenderPipeline renderPipeline) - { - _renderPipeline = renderPipeline; - renderPipeline.Activate(this); - } - } -} \ No newline at end of file diff --git a/Legacy/Window/GenericWindow.cs b/Legacy/Window/GenericWindow.cs deleted file mode 100644 index cb6a887..0000000 --- a/Legacy/Window/GenericWindow.cs +++ /dev/null @@ -1,296 +0,0 @@ -#region usings - -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using OpenTK; -using OpenTK.Graphics; -using OpenTK.Graphics.OpenGL4; -using OpenTK.Input; -using SM.Base.Contexts; -using SM.Base.Drawing; -using SM.Base.Objects.Static; -using SM.Base.PostProcess; -using SM.Base.Scene; -using SM.Base.ShaderExtension; -using SM.Base.Time; -using SM.OGL; -using SM.OGL.Framebuffer; -using SM.Utility; - -#endregion - -namespace SM.Base -{ - /// - /// The base window. - /// - public abstract class GenericWindow : GameWindow, IGenericWindow - { - protected GenericCamera _viewportCamera; - - internal bool _loading = true; - internal List _actionsAfterLoading = new List(); - - public bool Loading => _loading; - - /// - /// This tells you the current world scale. - /// - public Vector2 WorldScale { get; set; } = Vector2.Zero; - - /// - /// This tells you the current aspect ratio of this window. - /// - public float Aspect { get; set; } - - /// - /// If false, the window will not react on updates and will not render something. - /// - /// Default: false - /// - /// - public bool ReactWhileUnfocused = false; - - public GenericCamera ViewportCamera => _viewportCamera; - public bool ForceViewportCamera { get; set; } - - /// - protected GenericWindow() : this(1280, 720, "Generic OGL Title", GameWindowFlags.Default) - { - } - - /// - /// Creates a window... - /// - protected GenericWindow(int width, int height, string title, GameWindowFlags flags, bool vSync = true) : base(width, height, - GraphicsMode.Default, title, flags, DisplayDevice.Default, GLSettings.ForcedVersion.MajorVersion, - GLSettings.ForcedVersion.MinorVersion, GraphicsContextFlags.Default) - { - VSync = vSync ? VSyncMode.On : VSyncMode.Off; - } - - - /// - protected override void OnLoad(EventArgs e) - { - GenericWindowCode.Load(this); - - base.OnLoad(e); - } - - /// - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - - GenericWindowCode.Resize(this); - - if (_loading) - { - _loading = false; - - OnLoaded(); - - _actionsAfterLoading.ForEach(a => a()); - _actionsAfterLoading = null; - } - } - - /// - /// This is triggered after all the window-loading has been done. - /// - protected virtual void OnLoaded() - { - } - - /// - /// Sets the world scale. - /// - public virtual void SetWorldScale() - { - } - - /// - protected override void OnUpdateFrame(FrameEventArgs e) - { - if (!ReactWhileUnfocused && !Focused) return; - - base.OnUpdateFrame(e); - - Deltatime.UpdateDelta = (float) e.Time; - var context = new UpdateContext - { - KeyboardState = Keyboard.GetState(), - MouseState = Mouse.GetState() - }; - - if (context.KeyboardState[Key.AltLeft] && context.KeyboardState[Key.F4]) Close(); - - Update(e, ref context); - } - - /// - /// Updates the system. - /// - /// - /// - protected virtual void Update(FrameEventArgs e, ref UpdateContext context) - { - Stopwatch.PerformTicks(context); - } - - /// - /// Grabs the cursor and make sure it doesn't leave the window. - /// - /// If true, it makes the cursor invisible. - public void GrabCursor(bool makeItInvisible = true) - { - CursorGrabbed = true; - CursorVisible = !makeItInvisible; - } - - /// - /// Ungrabs the cursor. - /// - public void UngrabCursor() - { - CursorGrabbed = false; - if (!CursorVisible) CursorVisible = true; - } - - /// - /// Create a bitmap from the framebuffer. - /// - public Bitmap TakeScreenshot(Framebuffer framebuffer, ReadBufferMode readBuffer, int x, int y, int width, int height) - { - GL.GetInteger(GetPName.FramebufferBinding, out int prevFBId); - GL.GetInteger(GetPName.DrawFramebufferBinding, out int prevFBDrawId); - GL.GetInteger(GetPName.ReadFramebufferBinding, out int prevFBReadId); - - Bitmap b = new Bitmap(width, height); - System.Drawing.Imaging.BitmapData bits = b.LockBits(new Rectangle(0, 0, width, height), - System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); - - GL.BindFramebuffer(FramebufferTarget.ReadFramebuffer, framebuffer); - GL.ReadBuffer(readBuffer); - GL.ReadPixels(x, y, width, height, OpenTK.Graphics.OpenGL4.PixelFormat.Bgra, PixelType.UnsignedByte, - bits.Scan0); - - b.UnlockBits(bits); - b.RotateFlip(RotateFlipType.RotateNoneFlipY); - - GL.BindFramebuffer(FramebufferTarget.Framebuffer, prevFBId); - GL.BindFramebuffer(FramebufferTarget.DrawFramebuffer, prevFBDrawId); - GL.BindFramebuffer(FramebufferTarget.ReadFramebuffer, prevFBReadId); - - return b; - } - } - - /// - /// The base window. - /// - /// The scene type - /// The camera type - public abstract class GenericWindow : GenericWindow, IGenericWindow - where TScene : GenericScene, new() - where TCamera : GenericCamera, new() - { - private RenderPipeline _renderPipeline; - private TScene _scene; - - /// - protected GenericWindow() - { - _viewportCamera = new TCamera(); - } - - /// - /// The viewport camera. - /// - public TCamera ViewportCamera { - get => (TCamera)_viewportCamera; - set => _viewportCamera = value; - } - - /// - /// This forces the render to use the viewport camera. - /// - public bool ForceViewportCamera { get; set; } = false; - - /// - /// The current scene. - /// - public TScene CurrentScene => _scene; - - /// - /// Controls how a scene is rendered. - /// - public RenderPipeline RenderPipeline => _renderPipeline; - - /// - protected override void Update(FrameEventArgs e, ref UpdateContext context) - { - base.Update(e, ref context); - context.CurrentScene = CurrentScene; - CurrentScene?.Update(context); - } - - /// - protected override void OnRenderFrame(FrameEventArgs e) - { - if (!ReactWhileUnfocused && !Focused) return; - - base.OnRenderFrame(e); - - GenericWindowCode.Render(this, (float)e.Time); - - SwapBuffers(); - - GLDebugging.CheckGLErrors(); - } - - /// - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - - GenericWindowCode.Resize(this); - } - - /// - /// Sets the scene. - /// - /// - public virtual void SetScene(TScene scene) - { - if (_loading) - { - _actionsAfterLoading.Add(() => SetScene(scene)); - return; - } - - _scene = scene; - scene.Activate(); - RenderPipeline.SceneChanged(scene); - } - - /// - /// Defines the render pipeline. - /// - /// - public void SetRenderPipeline(RenderPipeline pipeline) - { - if (_loading) - { - _actionsAfterLoading.Add(() => SetRenderPipeline(pipeline)); - return; - } - - _renderPipeline = pipeline; - pipeline.Activate(this); - } - } -} \ No newline at end of file diff --git a/Legacy/Window/GenericWindowCode.cs b/Legacy/Window/GenericWindowCode.cs deleted file mode 100644 index 115ef15..0000000 --- a/Legacy/Window/GenericWindowCode.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using OpenTK; -using OpenTK.Graphics.OpenGL4; -using SM.Base.Contexts; -using SM.Base.Drawing; -using SM.Base.Objects.Static; -using SM.Base.PostProcess; -using SM.Base.Scene; -using SM.Base.ShaderExtension; -using SM.OGL; -using SM.Utility; - -namespace SM.Base -{ - public class GenericWindowCode - { - internal static void Load(IGenericWindow window) - { - SMRenderer.CurrentWindow = window; - - GLSystem.INIT_SYSTEM(); - GLSettings.ShaderPreProcessing = true; - - var args = Environment.GetCommandLineArgs(); - if (args.Contains("--advDebugging")) - { - SMRenderer.AdvancedDebugging = true; - GLSettings.InfoEveryUniform = true; - } - - Log.Init(); - - Log.Write("#", ConsoleColor.Cyan, "----------------------", - "--- OpenGL Loading ---", - "----------------------------------", - $"--- {"DeviceVersion",14}: {GLSystem.DeviceVersion,-10} ---", - $"--- {"ForcedVersion",14}: {GLSettings.ForcedVersion,-10} ---", - $"--- {"ShadingVersion",14}: {GLSystem.ShadingVersion,-10} ---", - $"--- {"Debugging",14}: {GLSystem.Debugging,-10} ---", - $"--- {"AdvDebugging",14}: {SMRenderer.AdvancedDebugging,-10} ---", - "----------------------------------"); - - if (SMRenderer.AdvancedDebugging) Log.Write("Extension", ConsoleColor.DarkCyan, GLSystem.Extensions); - - ExtensionManager.InitExtensions(); - } - - internal static void Resize(IGenericWindow window) - { - window.Aspect = (float) window.Width / window.Height; - window.WorldScale = new Vector2(window.Width, window.Height); - window.SetWorldScale(); - GL.Viewport(window.ClientRectangle); - } - - internal static void Resize(IGenericWindow window) - where TScene : GenericScene, new() - where TCamera : GenericCamera, new() - { - window.ViewportCamera.RecalculateWorld(window.WorldScale, window.Aspect); - window.RenderPipeline?.Resize(); - - PostProcessEffect.Model = Matrix4.CreateScale(window.WorldScale.X, -window.WorldScale.Y, 1); - PostProcessEffect.Mvp = PostProcessEffect.Model * - Matrix4.LookAt(0, 0, 1, 0, 0, 0, 0, 1, 0) * - GenericCamera.OrthographicWorld; - } - - internal static void Render(IGenericWindow window, float deltatime) - where TScene : GenericScene, new() - where TCamera : GenericCamera, new() - { - if (window.CurrentScene == null) return; - - SMRenderer.CurrentFrame++; - - Deltatime.RenderDelta = deltatime; - var drawContext = new DrawContext - { - ForceViewport = window.ForceViewportCamera, - ActiveScene = window.CurrentScene, - Window = window, - - Instances = new[] - { - new Instance - {ModelMatrix = Matrix4.Identity, TexturePosition = Vector2.Zero, TextureScale = Vector2.One} - }, - Mesh = Plate.Object, - - WorldScale = window.WorldScale, - LastPassthough = window, - - ShaderArguments = new Dictionary(), - - World = window.ViewportCamera.World, - View = window.ViewportCamera.CalculateViewMatrix(), - ModelMaster = Matrix4.Identity - }; - - - window.RenderPipeline?.Render(ref drawContext); - } - } -} \ No newline at end of file diff --git a/Legacy/Window/IGLWindow2D.cs b/Legacy/Window/IGLWindow2D.cs deleted file mode 100644 index 1d783e3..0000000 --- a/Legacy/Window/IGLWindow2D.cs +++ /dev/null @@ -1,14 +0,0 @@ -using OpenTK; -using SM.Base; -using SM2D.Controls; -using SM2D.Scene; - -namespace SM2D -{ - public interface IGLWindow2D : IGenericWindow - { - Vector2? Scaling { get; set; } - - Mouse2D Mouse { get; } - } -} \ No newline at end of file diff --git a/Legacy/Window/IGenericWindow.cs b/Legacy/Window/IGenericWindow.cs deleted file mode 100644 index bc93341..0000000 --- a/Legacy/Window/IGenericWindow.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Drawing; -using System.Windows; -using OpenTK; -using SM.Base.Scene; -using SM.OGL.Framebuffer; - -namespace SM.Base -{ - public interface IGenericWindow : IFramebufferWindow - { - bool Loading { get; } - float Aspect { get; set; } - - GenericCamera ViewportCamera { get; } - bool ForceViewportCamera { get; set; } - - int Width { get; } - int Height { get; } - - Rectangle ClientRectangle { get; } - Vector2 WorldScale { get; set; } - - void SetWorldScale(); - } - - public interface IGenericWindow : IGenericWindow - where TScene : GenericScene, new() - where TCamera : GenericCamera, new() - { - TScene CurrentScene { get; } - - RenderPipeline RenderPipeline { get; } - - void SetScene(TScene scene); - void SetRenderPipeline(RenderPipeline renderPipeline); - } -} \ No newline at end of file diff --git a/Legacy/Window/RenderPipeline.cs b/Legacy/Window/RenderPipeline.cs deleted file mode 100644 index 689511a..0000000 --- a/Legacy/Window/RenderPipeline.cs +++ /dev/null @@ -1,150 +0,0 @@ -#region usings - -using System.Collections.Generic; -using System.Threading; -using SM.Base.Contexts; -using SM.Base.Drawing; -using SM.Base.Scene; -using SM.OGL.Framebuffer; - -#endregion - -namespace SM.Base -{ - /// - /// Definition of specific render options. - /// - public abstract class RenderPipeline - { - /// - /// If true, this pipeline was already once activated. - /// - public bool IsInitialized { get; private set; } = false; - - /// - /// The window the pipeline is connected to. - /// - protected IGenericWindow _window { get; private set; } - - /// - /// The framebuffers, that are used in this Pipeline. - /// - public virtual List Framebuffers { get; private set; } - - /// - /// The default shader for the pipeline. - /// - protected internal virtual MaterialShader _defaultShader { get; set; } - - public virtual Framebuffer MainFramebuffer { get; protected set; }= Framebuffer.Screen; - - /// - /// Occurs, when the window is loading. - /// - protected internal virtual void Load() - { - } - - /// - /// Occurs, when the window is resizing. - /// - protected internal virtual void Resize() - { - if (Framebuffers == null) return; - - foreach (var framebuffer in Framebuffers) - framebuffer.Dispose(); - - Thread.Sleep(50); - - foreach (Framebuffer framebuffer in Framebuffers) - { - framebuffer.Compile(); - } - } - - internal void Activate(IGenericWindow window) - { - _window = window; - - if (!IsInitialized) - { - if (_defaultShader == null) _defaultShader = SMRenderer.DefaultMaterialShader; - Framebuffers = new List(); - - Initialization(window); - - Framebuffers.Add(MainFramebuffer); - - IsInitialized = true; - } - - Activation(window); - } - - /// - /// Occurs, when the pipeline was connected to a window. - /// - protected internal virtual void Activation(IGenericWindow window) - { - } - - - /// - /// Occurs, when the pipeline was connected to a window the first time. - /// - /// - protected internal virtual void Initialization(IGenericWindow window) - { - - } - - /// - /// Occurs, when the window is unloading. - /// - protected internal virtual void Unload() - { - } - - /// - /// Creates a framebuffer, that has specific (often) required settings already applied. - /// - /// - public static Framebuffer CreateWindowFramebuffer() - { - Framebuffer framebuffer = new Framebuffer(window: SMRenderer.CurrentWindow); - framebuffer.Append("color", 0); - return framebuffer; - } - } - - /// - /// Represents a render pipeline. - /// - /// The scene type - public abstract class RenderPipeline : RenderPipeline - where TScene : GenericScene - { - /// - /// The system to render stuff. - /// - internal void Render(ref DrawContext context) - { - context.ActivePipeline = this; - if (context.ActiveScene == null) return; - - RenderProcess(ref context, (TScene)context.ActiveScene); - } - - protected abstract void RenderProcess(ref DrawContext context, TScene scene); - - /// - /// Event, that triggers, when the scene in the current window changes. - /// - /// - protected internal virtual void SceneChanged(TScene scene) - { - - } - } -} \ No newline at end of file diff --git a/MigrationBackup/d4ed0f1f/SMRenderer/SM2D/NuGetUpgradeLog.html b/MigrationBackup/d4ed0f1f/SMRenderer/SM2D/NuGetUpgradeLog.html deleted file mode 100644 index 20325c2..0000000 --- a/MigrationBackup/d4ed0f1f/SMRenderer/SM2D/NuGetUpgradeLog.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - NuGetMigrationLog -

- NuGet Migration Report - SMRenderer\SM2D

Overview

Migration to PackageReference was completed successfully. Please build and run your solution to verify that all packages are available.
- If you run into any problems, have feedback, questions, or concerns, please - file an issue on the NuGet GitHub repository.

Packages processed

Top-level dependencies:

Package IdVersion
OpenTK - v3.2.1

Transitive dependencies:

Package IdVersion
- No transitive dependencies found. -

Package compatibility issues

Description
- No issues were found. -
\ No newline at end of file diff --git a/MigrationBackup/d4ed0f1f/SMRenderer/SM2D/SM2D.csproj b/MigrationBackup/d4ed0f1f/SMRenderer/SM2D/SM2D.csproj deleted file mode 100644 index b87112a..0000000 --- a/MigrationBackup/d4ed0f1f/SMRenderer/SM2D/SM2D.csproj +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Debug - AnyCPU - {A4565538-625A-42C6-A330-DD4F1ABB3986} - Library - Properties - SM2D - SM2D - v4.5.2 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\packages\OpenTK.3.2.1\lib\net20\OpenTK.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {8e733844-4204-43e7-b3dc-3913cddabb0d} - SM.Base - - - {f604d684-bc1d-4819-88b5-8b5d03a17be0} - SM.OGL - - - - - - - - - \ No newline at end of file diff --git a/MigrationBackup/d4ed0f1f/SMRenderer/SM2D/packages.config b/MigrationBackup/d4ed0f1f/SMRenderer/SM2D/packages.config deleted file mode 100644 index 9a4debe..0000000 --- a/MigrationBackup/d4ed0f1f/SMRenderer/SM2D/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file