using System.Collections.Generic; using SM.Base.Contexts; using SM.Base.Scene; using SM.OGL.Framebuffer; namespace SM.Base { /// /// Definition of specific render options. /// public abstract class RenderPipeline { /// /// The framebuffers, that are used in this Pipeline. /// protected virtual List _framebuffers { get; } /// /// The default shader for the pipeline. /// protected internal virtual IShader _defaultShader { get; } /// /// Occurs, when the window is loading. /// protected internal virtual void Load() { foreach (Framebuffer framebuffer in _framebuffers) framebuffer.Compile(); } /// /// Occurs, when the window is resizing. /// protected internal virtual void Resize() { } /// /// Occurs, when the pipeline was connected to a window. /// protected internal virtual void Activate(GenericWindow window) { } /// /// Occurs, when the window is unloading. /// protected internal virtual void Unload() { foreach (Framebuffer framebuffer in _framebuffers) { framebuffer.Dispose(); } } } /// /// Represents a render pipeline. /// /// The scene type public abstract class RenderPipeline : RenderPipeline where TScene : GenericScene { /// /// The system to render stuff. /// protected internal virtual void Render(ref DrawContext context, TScene scene) { context.ActivePipeline = this; } } }