Merge branch 'master' of https://github.com/IedSoftworks/SMRendererV3
This commit is contained in:
commit
3bc90dd83b
14 changed files with 190 additions and 49 deletions
|
|
@ -75,29 +75,57 @@ namespace SM.Base.Window
|
|||
/// </summary>
|
||||
public virtual void Resize()
|
||||
{
|
||||
if (Framebuffers == null) return;
|
||||
foreach (var framebuffer in Framebuffers)
|
||||
framebuffer.Dispose();
|
||||
Recompile();
|
||||
}
|
||||
|
||||
Thread.Sleep(50);
|
||||
|
||||
/// <summary>
|
||||
/// Compiles the framebuffers.
|
||||
/// </summary>
|
||||
public void Compile()
|
||||
{
|
||||
foreach (var framebuffer in Framebuffers)
|
||||
framebuffer.Compile();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recompiles the pipeline.
|
||||
/// </summary>
|
||||
public void Recompile()
|
||||
{
|
||||
if (Framebuffers == null) return;
|
||||
Dispose();
|
||||
|
||||
Thread.Sleep(100);
|
||||
|
||||
Compile();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes unmanaged resources like Framebuffers.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (var framebuffer in Framebuffers)
|
||||
framebuffer.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This creates a finished setup for a framebuffer.
|
||||
/// </summary>
|
||||
/// <param name="multisamples"></param>
|
||||
/// <returns></returns>
|
||||
public Framebuffer CreateWindowFramebuffer(int multisamples = 0)
|
||||
public Framebuffer CreateWindowFramebuffer(int multisamples = 0, PixelInformation? pixelInformation = null, bool depth = true)
|
||||
{
|
||||
Framebuffer framebuffer = new Framebuffer(ConnectedWindow);
|
||||
framebuffer.Append("color", new ColorAttachment(0, PixelInformation.RGBA_LDR, multisamples));
|
||||
|
||||
RenderbufferAttachment depthAttach = RenderbufferAttachment.Depth;
|
||||
depthAttach.Multisample = multisamples;
|
||||
framebuffer.AppendRenderbuffer(depthAttach);
|
||||
framebuffer.Append("color", new ColorAttachment(0, pixelInformation.GetValueOrDefault(PixelInformation.RGBA_LDR), multisamples));
|
||||
|
||||
if (depth)
|
||||
{
|
||||
RenderbufferAttachment depthAttach = RenderbufferAttachment.Depth;
|
||||
depthAttach.Multisample = multisamples;
|
||||
framebuffer.AppendRenderbuffer(depthAttach);
|
||||
}
|
||||
|
||||
return framebuffer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ using SM.Base.Shaders.Extensions;
|
|||
using SM.Base.Time;
|
||||
using SM.Base.Utility;
|
||||
using SM.OGL;
|
||||
using SM.OGL.Framebuffer;
|
||||
using Keyboard = SM.Base.Controls.Keyboard;
|
||||
using Mouse = SM.Base.Controls.Mouse;
|
||||
|
||||
|
|
@ -26,6 +27,7 @@ namespace SM.Base.Window
|
|||
{
|
||||
GLSystem.INIT_SYSTEM();
|
||||
GLSettings.ShaderPreProcessing = true;
|
||||
Framebuffer.ScreenWindow = window;
|
||||
|
||||
var args = Environment.GetCommandLineArgs();
|
||||
if (args.Contains("--advDebugging"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue