diff --git a/src/lib.rs b/src/lib.rs index 7c5680b..26775d8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -480,6 +480,16 @@ pub trait HasContext { pixels: Option<&[u8]>, ); + unsafe fn tex_image_2d_multisample( + &self, + target: u32, + samples: i32, + internal_format: u32, + width: i32, + height: i32, + fixedsamplelocations: bool, + ); + unsafe fn tex_image_3d( &self, target: u32, diff --git a/src/native.rs b/src/native.rs index 1328261..e5363e2 100644 --- a/src/native.rs +++ b/src/native.rs @@ -1093,6 +1093,26 @@ impl HasContext for Context { ); } + unsafe fn tex_image_2d_multisample( + &self, + target: u32, + samples: i32, + internal_format: u32, + width: i32, + height: i32, + fixedsamplelocations: bool, + ) { + let gl = &self.raw; + gl.TexImage2DMultisample( + target, + samples, + internal_format, + width, + height, + fixedsamplelocations as u8, + ); + } + unsafe fn tex_image_3d( &self, target: u32, diff --git a/src/web_sys.rs b/src/web_sys.rs index 7d9ce17..771082f 100644 --- a/src/web_sys.rs +++ b/src/web_sys.rs @@ -1850,6 +1850,18 @@ impl HasContext for Context { } } + unsafe fn tex_image_2d_multisample( + &self, + _target: u32, + _samples: i32, + _internal_format: u32, + _width: i32, + _height: i32, + _fixedsamplelocations: bool, + ) { + panic!("WebGL2 does not support glTexImage2DMultisample - switch to glRenderbufferStorageMultisample"); + } + unsafe fn tex_image_3d( &self, target: u32,