Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
20 changes: 20 additions & 0 deletions src/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions src/web_sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down