Improved PostProcessing System

This commit is contained in:
Michel Fedde 2020-12-13 16:13:00 +01:00
parent 0ab7f29b06
commit e4e7db8dc0
10 changed files with 181 additions and 6 deletions

View file

@ -16,6 +16,10 @@ namespace SM.Base
/// </summary>
public abstract class RenderPipeline
{
public bool IsInitialized { get; private set; } = false;
protected GenericWindow _window { get; private set; }
/// <summary>
/// The framebuffers, that are used in this Pipeline.
/// </summary>
@ -51,19 +55,46 @@ namespace SM.Base
}
}
internal void Activate(GenericWindow window)
{
_window = window;
if (!IsInitialized)
{
Initialization(window);
IsInitialized = true;
}
Activation(window);
}
/// <summary>
/// Occurs, when the pipeline was connected to a window.
/// </summary>
protected internal virtual void Activate(GenericWindow window)
protected internal virtual void Activation(GenericWindow window)
{
}
protected internal virtual void Initialization(GenericWindow window)
{
}
/// <summary>
/// Occurs, when the window is unloading.
/// </summary>
protected internal virtual void Unload()
{
}
protected Framebuffer CreateWindowFramebuffer()
{
Framebuffer framebuffer = new Framebuffer(window: _window);
framebuffer.Append("color", 0);
framebuffer.Compile();
return framebuffer;
}
}
/// <summary>
@ -80,5 +111,10 @@ namespace SM.Base
{
context.ActivePipeline = this;
}
protected internal virtual void SceneChanged(TScene scene)
{
}
}
}