public void Prepare(int width, int height, int samples) { if (Width == width && Height == height && Samples == samples) { return; } Width = width; Height = height; Samples = samples; Framebuffer.Detach(FramebufferAttachmentPoint.Color0); Framebuffer.Detach(FramebufferAttachmentPoint.DepthStencil); ColorBuffer?.Dispose(); DepthBuffer?.Dispose(); ResolvedTex?.Dispose(); ColorBuffer = infra.GlContext.Create.Renderbuffer(width, height, Format.Srgb8Alpha8, samples); DepthBuffer = infra.GlContext.Create.Renderbuffer(width, height, Format.Depth24Stencil8, samples); ResolvedTex = infra.GlContext.Create.Texture2D(width, height, GraphicsHelper.TextureMipCount(width, height), Format.Srgb8Alpha8); Framebuffer.AttachRenderbuffer(FramebufferAttachmentPoint.Color0, ColorBuffer); Framebuffer.AttachRenderbuffer(FramebufferAttachmentPoint.DepthStencil, DepthBuffer); }
public void Dispose() { resolveFramebuffer?.Dispose(); Framebuffer?.Dispose(); ColorBuffer?.Dispose(); DepthBuffer?.Dispose(); ResolvedTex?.Dispose(); }
protected void Dispose(bool disposing) { if (disposing) { PositionBuffer?.Dispose(); NormalBuffer?.Dispose(); TangentBuffer?.Dispose(); TexCoordBuffer?.Dispose(); TexCoord2Buffer?.Dispose(); ColorBuffer?.Dispose(); foreach (var indexTable in IndexTables) { indexTable.Dispose(); } } GL.DeleteVertexArray(VertexArrayID); }
public void Dispose() { VoxelBuffer.Dispose(); ColorBuffer.Dispose(); NormalBuffer.Dispose(); }