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>
|
<Name>SM.OGL</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="PostProcess\DefaultFiles\vertexWithExt.vert" />
|
<EmbeddedResource Include="PostProcess\DefaultFiles\vertexWithExt.vert" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ namespace SM.Base.Window
|
||||||
foreach (var framebuffer in Framebuffers)
|
foreach (var framebuffer in Framebuffers)
|
||||||
framebuffer.Dispose();
|
framebuffer.Dispose();
|
||||||
|
|
||||||
Thread.Sleep(50);
|
Thread.Sleep(100);
|
||||||
|
|
||||||
foreach (var framebuffer in Framebuffers)
|
foreach (var framebuffer in Framebuffers)
|
||||||
framebuffer.Compile();
|
framebuffer.Compile();
|
||||||
|
|
@ -90,14 +90,17 @@ namespace SM.Base.Window
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="multisamples"></param>
|
/// <param name="multisamples"></param>
|
||||||
/// <returns></returns>
|
/// <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 framebuffer = new Framebuffer(ConnectedWindow);
|
||||||
framebuffer.Append("color", new ColorAttachment(0, PixelInformation.RGBA_LDR, multisamples));
|
framebuffer.Append("color", new ColorAttachment(0, pixelInformation.GetValueOrDefault(PixelInformation.RGBA_LDR), multisamples));
|
||||||
|
|
||||||
|
if (depth)
|
||||||
|
{
|
||||||
RenderbufferAttachment depthAttach = RenderbufferAttachment.Depth;
|
RenderbufferAttachment depthAttach = RenderbufferAttachment.Depth;
|
||||||
depthAttach.Multisample = multisamples;
|
depthAttach.Multisample = multisamples;
|
||||||
framebuffer.AppendRenderbuffer(depthAttach);
|
framebuffer.AppendRenderbuffer(depthAttach);
|
||||||
|
}
|
||||||
|
|
||||||
return framebuffer;
|
return framebuffer;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,9 @@ namespace SM.OGL.Framebuffer
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override bool AutoCompile { get; set; } = true;
|
protected override bool AutoCompile { get; set; } = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The window for the screen
|
||||||
|
/// </summary>
|
||||||
public static IFramebufferWindow ScreenWindow;
|
public static IFramebufferWindow ScreenWindow;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,14 @@
|
||||||
<Compile Include="Types\Transformation.cs" />
|
<Compile Include="Types\Transformation.cs" />
|
||||||
<Compile Include="Window\Window2DSetup.cs" />
|
<Compile Include="Window\Window2DSetup.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="OpenTK">
|
||||||
|
<Version>3.3.1</Version>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Shader\ShaderFiles\basic.glsl" />
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\SM.Base\SM.Base.csproj">
|
<ProjectReference Include="..\SM.Base\SM.Base.csproj">
|
||||||
<Project>{8e733844-4204-43e7-b3dc-3913cddabb0d}</Project>
|
<Project>{8e733844-4204-43e7-b3dc-3913cddabb0d}</Project>
|
||||||
|
|
@ -63,14 +71,5 @@
|
||||||
<Name>SM.OGL</Name>
|
<Name>SM.OGL</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</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" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{6D4FB8E6-4D0B-4928-8F9E-EF5C2FBF44E8}</ProjectGuid>
|
<ProjectGuid>{6D4FB8E6-4D0B-4928-8F9E-EF5C2FBF44E8}</ProjectGuid>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<RootNamespace>SM_TEST</RootNamespace>
|
<RootNamespace>SM_TEST</RootNamespace>
|
||||||
<AssemblyName>SM_TEST</AssemblyName>
|
<AssemblyName>SM_TEST</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||||
|
|
@ -32,6 +32,9 @@
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<StartupObject />
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="OpenTK, Version=3.3.1.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
<Reference Include="OpenTK, Version=3.3.1.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\OpenTK.3.3.1\lib\net20\OpenTK.dll</HintPath>
|
<HintPath>..\packages\OpenTK.3.3.1\lib\net20\OpenTK.dll</HintPath>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue