main
Nathan Buck 11 months ago
parent f6f3ae98ac
commit 1e315fa433

@ -2,7 +2,7 @@ use memoffset::offset_of;
use ash::vk; use ash::vk;
use rand::{thread_rng, distributions::{Distribution, Uniform}}; use rand::{thread_rng, distributions::{Distribution, Uniform}};
use cgmath::{InnerSpace, Vector2, Vector4}; use cgmath::{InnerSpace, Vector2, Vector4};
use num::traits::FloatConst;
use crate::utility::constants::*; use crate::utility::constants::*;
use std::f32::consts::PI; use std::f32::consts::PI;
@ -23,7 +23,7 @@ impl Particle {
let between = Uniform::from(0.0..1.0); let between = Uniform::from(0.0..1.0);
let mut rng = thread_rng(); let mut rng = thread_rng();
for i in 0..PARTICLE_COUNT { for _i in 0..PARTICLE_COUNT {
let r = (between.sample(&mut rng) as f32).sqrt(); let r = (between.sample(&mut rng) as f32).sqrt();
let theta = between.sample(&mut rng) * 2.0 * PI; let theta = between.sample(&mut rng) * 2.0 * PI;
let x = r * theta.cos() * WINDOW_HEIGHT as f32 * WINDOW_WIDTH as f32; let x = r * theta.cos() * WINDOW_HEIGHT as f32 * WINDOW_WIDTH as f32;

@ -1,10 +1,10 @@
use crate::{ use crate::{
shaders::*, entities::*, utility, utility::constants::*, utility::debug::*, utility::share, utility::share::*, utility::structures::*, shaders::*, entities::*, utility, utility::constants::*, utility::debug::*, utility::share, utility::structures::*,
}; };
use ash::{vk, Entry}; use ash::{vk, Entry};
use memoffset::offset_of;
use vk::*;
use winit::event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent}; use winit::event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent};
use winit::event_loop::{ControlFlow, EventLoop}; use winit::event_loop::{ControlFlow, EventLoop};

@ -1,5 +1,5 @@
use ash::vk; use ash::vk;
use vk::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::os::raw::c_void; use std::os::raw::c_void;

@ -11,7 +11,7 @@ use crate::utility::constants::*;
use crate::utility::{debug, platforms}; use crate::utility::{debug, platforms};
use crate::utility::structures::*; use crate::utility::structures::*;
use super::*;
pub fn create_render_pass(device: &ash::Device, surface_format: vk::Format) -> vk::RenderPass { pub fn create_render_pass(device: &ash::Device, surface_format: vk::Format) -> vk::RenderPass {
let color_attachment = vk::AttachmentDescription { let color_attachment = vk::AttachmentDescription {
@ -1143,7 +1143,7 @@ pub fn create_logical_device(
.iter() .iter()
.map(|layer_name| CString::new(*layer_name).unwrap()) .map(|layer_name| CString::new(*layer_name).unwrap())
.collect(); .collect();
let enable_layer_names: Vec<*const c_char> = requred_validation_layer_raw_names let _enable_layer_names: Vec<*const c_char> = requred_validation_layer_raw_names
.iter() .iter()
.map(|layer_name| layer_name.as_ptr()) .map(|layer_name| layer_name.as_ptr())
.collect(); .collect();

Loading…
Cancel
Save