public FrameBuffer(int width, int height, FBOAttachment attachments = FBOAttachment.NONE) { Width = width; Height = height; Create(attachments); }
private void Create(FBOAttachment attachments) { var gl = XEngineContext.Graphics; gl.GenFramebuffersEXT(1u, glFrameBufferArray); gl.BindFramebufferEXT(OpenGL.GL_FRAMEBUFFER_EXT, Id); gl.DrawBuffer(OpenGL.GL_COLOR_ATTACHMENT0_EXT); if (attachments.HasFlag(FBOAttachment.TextureAttachment)) { AddTextureAttachment(); } if (attachments.HasFlag(FBOAttachment.DepthTextureAttachment)) { AddDepthTextureAttachment(); } if (attachments.HasFlag(FBOAttachment.DepthBufferAttachment)) { AddDepthBufferAttachment(); } gl.BindFramebufferEXT(OpenGL.GL_FRAMEBUFFER_EXT, 0u); }