Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
softwareantics committed Jan 14, 2024
1 parent 19f8790 commit 33404f4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
6 changes: 1 addition & 5 deletions FinalEngine.Rendering.OpenGL/Buffers/OpenGLFrameBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,10 @@ public OpenGLFrameBuffer(IOpenGLInvoker invoker, IReadOnlyList<IOpenGLTexture>?

if (colorAttachmentCount > 0)
{
Span<DrawBuffersEnum> bufs = stackalloc DrawBuffersEnum[colorAttachmentCount];

for (int i = 0; i < colorAttachmentCount; i++)
{
bufs[i] = DrawBuffersEnum.ColorAttachment0 + i;
this.invoker.NamedFramebufferDrawBuffer(this.rendererID, DrawBufferMode.ColorAttachment0 + i);
}

this.invoker.NamedFramebufferDrawBuffers(this.rendererID, colorAttachmentCount, ref bufs[0]);
}

depthTarget?.Attach(FramebufferAttachment.DepthAttachment, this.rendererID);
Expand Down
2 changes: 0 additions & 2 deletions FinalEngine.Rendering.OpenGL/Invocation/IOpenGLInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ void NamedBufferSubData<T3>(int buffer, IntPtr offset, int size, T3[] data)

void NamedFramebufferDrawBuffer(int framebuffer, DrawBufferMode buf);

void NamedFramebufferDrawBuffers(int fb, int n, ref DrawBuffersEnum bufs);

void NamedFramebufferReadBuffer(int framebuffer, ReadBufferMode buf);

void NamedFramebufferTexture(int framebuffer, FramebufferAttachment attachment, int texture, int level);
Expand Down
5 changes: 0 additions & 5 deletions FinalEngine.Rendering.OpenGL/Invocation/OpenGLInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,6 @@ public void Viewport(Rectangle rectangle)
GL.Viewport(rectangle);
}

public void NamedFramebufferDrawBuffers(int fb, int n, ref DrawBuffersEnum bufs)
{
GL.NamedFramebufferDrawBuffers(fb, n, ref bufs);
}

public void NamedFramebufferDrawBuffer(int framebuffer, DrawBufferMode buf)
{
GL.NamedFramebufferDrawBuffer(framebuffer, buf);
Expand Down
2 changes: 2 additions & 0 deletions FinalEngine.Rendering/RenderingEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public void Render(ICamera camera)
{
ArgumentNullException.ThrowIfNull(camera, nameof(camera));

this.renderDevice.Pipeline.SetFrameBuffer(null);
this.renderDevice.Rasterizer.SetViewport(camera.Bounds);
this.renderDevice.Clear(Color.Black);

this.renderDevice.OutputMerger.SetDepthState(new DepthStateDescription()
Expand Down

0 comments on commit 33404f4

Please sign in to comment.