Skip to content

Commit

Permalink
Merge pull request #45 from Svabik/patch-1
Browse files Browse the repository at this point in the history
Adding stencil to the Frame Buffer:  DxGLFrameBuffer.cs
  • Loading branch information
varon authored Mar 14, 2021
2 parents 7921a6c + 9f1929d commit 0e657c1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/GLWpfControl/DxGLFramebuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,18 @@ public DxGLFramebuffer([NotNull] DxGlContext context, int width, int height, dou

GLDepthRenderBufferHandle = GL.GenRenderbuffer();
GL.BindRenderbuffer(RenderbufferTarget.Renderbuffer, GLDepthRenderBufferHandle);
GL.RenderbufferStorage(RenderbufferTarget.Renderbuffer, RenderbufferStorage.DepthComponent24, FramebufferWidth, FramebufferHeight);
GL.RenderbufferStorage(RenderbufferTarget.Renderbuffer, RenderbufferStorage.Depth24Stencil8, FramebufferWidth, FramebufferHeight);

GL.FramebufferRenderbuffer(
FramebufferTarget.Framebuffer,
FramebufferAttachment.DepthAttachment,
RenderbufferTarget.Renderbuffer,
GLDepthRenderBufferHandle);
GL.FramebufferRenderbuffer(
FramebufferTarget.Framebuffer,
FramebufferAttachment.StencilAttachment,
RenderbufferTarget.Renderbuffer,
GLDepthRenderBufferHandle);

GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);

Expand Down

0 comments on commit 0e657c1

Please sign in to comment.