summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-11-10 20:11:23 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-11-10 20:11:23 +0100
commit45c749f28c8690ce0aaa6521f40e827281b8a7d1 (patch)
treeebb2557c74f5c8a1d122b34ab1a348376c1061bd /graphics
parent9d4f664c946e6475eaf2e8719ba56beee84a8fb8 (diff)
downloadiced-45c749f28c8690ce0aaa6521f40e827281b8a7d1.tar.gz
iced-45c749f28c8690ce0aaa6521f40e827281b8a7d1.tar.bz2
iced-45c749f28c8690ce0aaa6521f40e827281b8a7d1.zip
Update `bytemuck` dependency in `iced_graphics`
Diffstat (limited to 'graphics')
-rw-r--r--graphics/Cargo.toml5
-rw-r--r--graphics/src/triangle.rs9
2 files changed, 6 insertions, 8 deletions
diff --git a/graphics/Cargo.toml b/graphics/Cargo.toml
index dec24c59..5fe8b63e 100644
--- a/graphics/Cargo.toml
+++ b/graphics/Cargo.toml
@@ -12,11 +12,14 @@ font-icons = []
opengl = []
[dependencies]
-bytemuck = "1.2"
glam = "0.9"
raw-window-handle = "0.3"
thiserror = "1.0"
+[dependencies.bytemuck]
+version = "1.4"
+features = ["derive"]
+
[dependencies.iced_native]
version = "0.2"
path = "../native"
diff --git a/graphics/src/triangle.rs b/graphics/src/triangle.rs
index ce879ffc..eb1494b1 100644
--- a/graphics/src/triangle.rs
+++ b/graphics/src/triangle.rs
@@ -1,4 +1,5 @@
//! Draw geometry using meshes of triangles.
+use bytemuck::{Pod, Zeroable};
/// A set of [`Vertex2D`] and indices representing a list of triangles.
///
@@ -16,7 +17,7 @@ pub struct Mesh2D {
}
/// A two-dimensional vertex with some color in __linear__ RGBA.
-#[derive(Copy, Clone, Debug)]
+#[derive(Copy, Clone, Debug, Zeroable, Pod)]
#[repr(C)]
pub struct Vertex2D {
/// The vertex position
@@ -24,9 +25,3 @@ pub struct Vertex2D {
/// The vertex color in __linear__ RGBA.
pub color: [f32; 4],
}
-
-#[allow(unsafe_code)]
-unsafe impl bytemuck::Zeroable for Vertex2D {}
-
-#[allow(unsafe_code)]
-unsafe impl bytemuck::Pod for Vertex2D {}