Implement Default for CameraUniform

This commit is contained in:
Jarrod Doyle 2023-06-27 20:38:30 +01:00
parent 8470507391
commit 604f11a40f
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 6 additions and 1 deletions

View File

@ -4,7 +4,6 @@ use winit::event::{ElementState, KeyboardInput, VirtualKeyCode, WindowEvent};
use crate::render::Context;
// TODO: Implement Default rather than using new()
#[repr(C)]
#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
pub struct CameraUniform {
@ -14,6 +13,12 @@ pub struct CameraUniform {
_pad: f32,
}
impl Default for CameraUniform {
fn default() -> Self {
Self::new()
}
}
impl CameraUniform {
pub fn new() -> Self {
Self {