Created
September 11, 2013 21:31
-
-
Save tomspilman/6530056 to your computer and use it in GitHub Desktop.
Changing the depth/stencil.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a new depth buffer. | |
var newDepthBuffer = GL.GenRenderbuffer(); | |
// Set the format and size of the new depth buffer. | |
GL.BindRenderbuffer(RenderbufferTarget.Renderbuffer, newDepthBuffer); | |
GL.RenderbufferStorage(RenderbufferTarget.Renderbuffer, RenderbufferStorage.Depth24Stencil8, width, height); | |
// Attach the new depth buffer to the default backbuffer. | |
GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0); | |
GL.FramebufferRenderbuffer(FramebufferTarget.Framebuffer, FramebufferAttachment.DepthStencilAttachment, RenderbufferTarget.Renderbuffer, newDepthBuffer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment