Undo unnecessary color type change

This commit is contained in:
Anton-4 2020-12-05 17:58:45 +01:00
parent 0d46835135
commit 202cba9f81
2 changed files with 4 additions and 5 deletions

View File

@ -3,7 +3,6 @@
use crate::rect::Rect;
use crate::util::size_of_slice;
use crate::vertex::Vertex;
use cgmath::Vector3;
use wgpu::util::{BufferInitDescriptor, DeviceExt};
pub struct QuadBufferBuilder {
@ -28,7 +27,7 @@ impl QuadBufferBuilder {
coords.y - rect.height,
coords.x + rect.width,
coords.y,
rect.color.into(),
rect.color,
)
}
@ -38,7 +37,7 @@ impl QuadBufferBuilder {
min_y: f32,
max_x: f32,
max_y: f32,
color: Vector3<f32>,
color: [f32; 3]
) -> Self {
self.vertex_data.extend(&[
Vertex {

View File

@ -1,12 +1,12 @@
// Taken from https://github.com/sotrh/learn-wgpu
// by Benjamin Hansen, licensed under the MIT license
use cgmath::{Vector2, Vector3};
use cgmath::{Vector2};
#[derive(Copy, Clone)]
pub struct Vertex {
#[allow(dead_code)]
pub position: Vector2<f32>,
pub color: Vector3<f32>,
pub color: [f32; 3],
}
unsafe impl bytemuck::Pod for Vertex {}