Skip to content

Instantly share code, notes, and snippets.

@tomspilman
Created September 11, 2013 21:31
Show Gist options
  • Save tomspilman/6530056 to your computer and use it in GitHub Desktop.
Save tomspilman/6530056 to your computer and use it in GitHub Desktop.
Changing the depth/stencil.
// 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