gl: Update to glow 0.11.0 (#594)

* gl: update for newtype wrappers Default impl

* build(deps): bump glow from 0.10.0 to 0.11.0

Bumps [glow](https://github.com/grovesNL/glow) from 0.10.0 to 0.11.0.
- [Release notes](https://github.com/grovesNL/glow/releases)
- [Commits](https://github.com/grovesNL/glow/commits)

---
updated-dependencies:
- dependency-name: glow
  dependency-type: direct:production
  update-type: version-update:semver-minor
This commit is contained in:
dependabot[bot] 2021-09-01 19:21:49 -07:00 committed by GitHub
parent 0d5feb9454
commit 83bbb9fe4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 9 deletions

4
Cargo.lock generated
View File

@ -784,9 +784,9 @@ dependencies = [
[[package]] [[package]]
name = "glow" name = "glow"
version = "0.10.0" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "945be163fdb893227410c8b44c2412dade922585b262d1daa6a7e96135217d4c" checksum = "4f04649123493bc2483cbef4daddb45d40bbdae5adb221a63a23efdb0cc99520"
dependencies = [ dependencies = [
"js-sys", "js-sys",
"slotmap", "slotmap",

View File

@ -30,7 +30,7 @@ opt-level = 1
cfg-if = "1.0.0" cfg-if = "1.0.0"
wasm-bindgen = "0.2.76" wasm-bindgen = "0.2.76"
winit = { version = "0.25.0", features = [ "web-sys" ]} winit = { version = "0.25.0", features = [ "web-sys" ]}
glow = "0.10.0" glow = "0.11.0"
byteorder = "1.4.3" byteorder = "1.4.3"
serde = "1.0.129" serde = "1.0.129"
serde_json = "1.0.66" serde_json = "1.0.66"

View File

@ -259,7 +259,6 @@ pub const NEAREST_MIPMAP_LINEAR: TextureValue = gl::NEAREST_MIPMAP_LINEAR as Tex
pub const CLAMP_TO_EDGE: TextureValue = gl::CLAMP_TO_EDGE as TextureValue; pub const CLAMP_TO_EDGE: TextureValue = gl::CLAMP_TO_EDGE as TextureValue;
/// `Texture` is a buffer of data used by fragment shaders. /// `Texture` is a buffer of data used by fragment shaders.
#[derive(Default)]
pub struct Texture(glow::Texture); pub struct Texture(glow::Texture);
impl Texture { impl Texture {
@ -440,6 +439,12 @@ impl Texture {
} }
} }
impl Default for Texture {
fn default() -> Self {
Self::new()
}
}
impl Drop for Texture { impl Drop for Texture {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {
@ -459,7 +464,6 @@ pub type ShaderParameter = u32;
pub const COMPILE_STATUS: ShaderParameter = gl::COMPILE_STATUS; pub const COMPILE_STATUS: ShaderParameter = gl::COMPILE_STATUS;
pub const INFO_LOG_LENGTH: ShaderParameter = gl::INFO_LOG_LENGTH; pub const INFO_LOG_LENGTH: ShaderParameter = gl::INFO_LOG_LENGTH;
#[derive(Default)]
pub struct Program(glow::Program); pub struct Program(glow::Program);
impl Program { impl Program {
@ -500,6 +504,12 @@ impl Program {
} }
} }
impl Default for Program {
fn default() -> Self {
Self::new()
}
}
impl Drop for Program { impl Drop for Program {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {
@ -649,7 +659,6 @@ impl Attribute {
// VertexArray is used to store state needed to render vertices. // VertexArray is used to store state needed to render vertices.
// This includes buffers, the format of the buffers and enabled // This includes buffers, the format of the buffers and enabled
// attributes. // attributes.
#[derive(Default)]
pub struct VertexArray(glow::VertexArray); pub struct VertexArray(glow::VertexArray);
impl VertexArray { impl VertexArray {
@ -672,12 +681,17 @@ impl VertexArray {
} }
} }
impl Default for VertexArray {
fn default() -> Self {
Self::new()
}
}
impl Drop for VertexArray { impl Drop for VertexArray {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {
glow_context().delete_vertex_array(self.0); glow_context().delete_vertex_array(self.0);
} }
self.0 = glow::VertexArray::default();
} }
} }
@ -710,7 +724,6 @@ pub const READ_ONLY: Access = gl::READ_ONLY;
pub const WRITE_ONLY: Access = gl::WRITE_ONLY; pub const WRITE_ONLY: Access = gl::WRITE_ONLY;
/// `Buffer` is a storage for vertex data. /// `Buffer` is a storage for vertex data.
#[derive(Default)]
pub struct Buffer(glow::Buffer); pub struct Buffer(glow::Buffer);
impl Buffer { impl Buffer {
@ -765,6 +778,12 @@ impl Buffer {
} }
} }
impl Default for Buffer {
fn default() -> Self {
Self::new()
}
}
impl Drop for Buffer { impl Drop for Buffer {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {
@ -809,9 +828,14 @@ pub const COLOR_ATTACHMENT_1: Attachment = gl::COLOR_ATTACHMENT1;
pub const COLOR_ATTACHMENT_2: Attachment = gl::COLOR_ATTACHMENT2; pub const COLOR_ATTACHMENT_2: Attachment = gl::COLOR_ATTACHMENT2;
pub const DEPTH_ATTACHMENT: Attachment = gl::DEPTH_ATTACHMENT; pub const DEPTH_ATTACHMENT: Attachment = gl::DEPTH_ATTACHMENT;
#[derive(Default)]
pub struct Framebuffer(glow::Framebuffer); pub struct Framebuffer(glow::Framebuffer);
impl Default for Framebuffer {
fn default() -> Self {
Self::new()
}
}
pub fn check_framebuffer_status() { pub fn check_framebuffer_status() {
unsafe { unsafe {
let status = glow_context().check_framebuffer_status(gl::FRAMEBUFFER); let status = glow_context().check_framebuffer_status(gl::FRAMEBUFFER);