+ comments to the SM.Base

+ Length, Normalize methods for CVectors
This commit is contained in:
Michel Fedde 2020-12-19 20:49:16 +01:00
parent 5d4b360b05
commit 9b917ac181
18 changed files with 248 additions and 33 deletions

View file

@ -182,6 +182,9 @@ namespace SM.Base
if (!CursorVisible) CursorVisible = true;
}
/// <summary>
/// Create a bitmap from the framebuffer.
/// </summary>
public Bitmap TakeScreenshot(Framebuffer framebuffer, ReadBufferMode readBuffer, int x, int y, int width, int height)
{
GL.GetInteger(GetPName.FramebufferBinding, out int prevFBId);

View file

@ -16,8 +16,14 @@ namespace SM.Base
/// </summary>
public abstract class RenderPipeline
{
/// <summary>
/// If true, this pipeline was already once activated.
/// </summary>
public bool IsInitialized { get; private set; } = false;
/// <summary>
/// The window the pipeline is connected to.
/// </summary>
protected GenericWindow _window { get; private set; }
/// <summary>
@ -76,6 +82,10 @@ namespace SM.Base
}
/// <summary>
/// Occurs, when the pipeline was connected to a window the first time.
/// </summary>
/// <param name="window"></param>
protected internal virtual void Initialization(GenericWindow window)
{
@ -88,6 +98,10 @@ namespace SM.Base
{
}
/// <summary>
/// Creates a framebuffer, that has specific (often) required settings already applied.
/// </summary>
/// <returns></returns>
public static Framebuffer CreateWindowFramebuffer()
{
Framebuffer framebuffer = new Framebuffer(window: SMRenderer.CurrentWindow);
@ -112,6 +126,10 @@ namespace SM.Base
context.ActivePipeline = this;
}
/// <summary>
/// Event, that triggers, when the scene in the current window changes.
/// </summary>
/// <param name="scene"></param>
protected internal virtual void SceneChanged(TScene scene)
{