Added more options to CreateWindowFramebuffer
This commit is contained in:
parent
7ffe566f9b
commit
d17d1ac765
5 changed files with 25 additions and 18 deletions
|
|
@ -121,7 +121,6 @@
|
|||
<Name>SM.OGL</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="PostProcess\DefaultFiles\vertexWithExt.vert" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ namespace SM.Base.Window
|
|||
foreach (var framebuffer in Framebuffers)
|
||||
framebuffer.Dispose();
|
||||
|
||||
Thread.Sleep(50);
|
||||
Thread.Sleep(100);
|
||||
|
||||
foreach (var framebuffer in Framebuffers)
|
||||
framebuffer.Compile();
|
||||
|
|
@ -90,14 +90,17 @@ namespace SM.Base.Window
|
|||
/// </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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ namespace SM.OGL.Framebuffer
|
|||
/// <inheritdoc />
|
||||
protected override bool AutoCompile { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// The window for the screen
|
||||
/// </summary>
|
||||
public static IFramebufferWindow ScreenWindow;
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -53,6 +53,14 @@
|
|||
<Compile Include="Types\Transformation.cs" />
|
||||
<Compile Include="Window\Window2DSetup.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OpenTK">
|
||||
<Version>3.3.1</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Shader\ShaderFiles\basic.glsl" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SM.Base\SM.Base.csproj">
|
||||
<Project>{8e733844-4204-43e7-b3dc-3913cddabb0d}</Project>
|
||||
|
|
@ -63,14 +71,5 @@
|
|||
<Name>SM.OGL</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="OpenTK">
|
||||
<Version>3.3.1</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Shader\ShaderFiles\basic.glsl" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
Loading…
Add table
Add a link
Reference in a new issue