diff --git a/src/lib.rs b/src/lib.rs index 8c3a8f2..86856f0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -745,6 +745,12 @@ pub trait HasContext: __private::Sealed { draw_buffer: u32, ); + unsafe fn named_framebuffer_draw_buffers( + &self, + framebuffer: Option, + buffers: &[u32], + ); + unsafe fn draw_buffers(&self, buffers: &[u32]); unsafe fn draw_elements(&self, mode: u32, count: i32, element_type: u32, offset: i32); diff --git a/src/native.rs b/src/native.rs index 70014d7..197a7c1 100644 --- a/src/native.rs +++ b/src/native.rs @@ -1689,6 +1689,19 @@ impl HasContext for Context { gl.DrawBuffers(buffers.len() as i32, buffers.as_ptr()); } + unsafe fn named_framebuffer_draw_buffers( + &self, + framebuffer: Option, + buffers: &[u32], + ) { + let gl = &self.raw; + gl.NamedFramebufferDrawBuffers( + framebuffer.map(|f| f.0.get()).unwrap_or(0), + buffers.len() as i32, + buffers.as_ptr(), + ); + } + unsafe fn draw_elements(&self, mode: u32, count: i32, element_type: u32, offset: i32) { let gl = &self.raw; gl.DrawElements( diff --git a/src/web_sys.rs b/src/web_sys.rs index d415004..fd4524d 100644 --- a/src/web_sys.rs +++ b/src/web_sys.rs @@ -3042,6 +3042,14 @@ impl HasContext for Context { } } + unsafe fn named_framebuffer_draw_buffers( + &self, + _framebuffer: Option, + _draw_buffers: &[u32], + ) { + panic!("Named framebuffers are not supported"); + } + unsafe fn draw_elements(&self, mode: u32, count: i32, element_type: u32, offset: i32) { match self.raw { RawRenderingContext::WebGl1(ref gl) => {