mirror of
https://github.com/FranLMSP/rmg-001.git
synced 2024-11-23 10:12:11 +00:00
Raspberry Pi 4 compatible
This commit is contained in:
parent
747a528c27
commit
0f0784b2ed
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -1171,6 +1171,7 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
"pixels",
|
"pixels",
|
||||||
"rand",
|
"rand",
|
||||||
|
"wgpu",
|
||||||
"winit",
|
"winit",
|
||||||
"winit_input_helper",
|
"winit_input_helper",
|
||||||
]
|
]
|
||||||
|
@ -14,5 +14,6 @@ rand = "0.8"
|
|||||||
env_logger = "0.9"
|
env_logger = "0.9"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
pixels = "0.7"
|
pixels = "0.7"
|
||||||
|
wgpu = "0.11"
|
||||||
winit = "0.25"
|
winit = "0.25"
|
||||||
winit_input_helper = "0.10"
|
winit_input_helper = "0.10"
|
||||||
|
@ -5,7 +5,7 @@ use crate::ppu::{WIDTH, HEIGHT};
|
|||||||
use std::{thread, time};
|
use std::{thread, time};
|
||||||
|
|
||||||
use log::error;
|
use log::error;
|
||||||
use pixels::{Pixels, SurfaceTexture};
|
use pixels::{Pixels, PixelsBuilder, SurfaceTexture};
|
||||||
use winit::dpi::LogicalSize;
|
use winit::dpi::LogicalSize;
|
||||||
use winit::event::{Event, VirtualKeyCode, WindowEvent};
|
use winit::event::{Event, VirtualKeyCode, WindowEvent};
|
||||||
use winit::event_loop::{ControlFlow, EventLoop};
|
use winit::event_loop::{ControlFlow, EventLoop};
|
||||||
@ -15,7 +15,20 @@ use winit_input_helper::WinitInputHelper;
|
|||||||
pub fn create_pixels(width: u32, height: u32, window: &Window) -> Pixels {
|
pub fn create_pixels(width: u32, height: u32, window: &Window) -> Pixels {
|
||||||
let window_size = window.inner_size();
|
let window_size = window.inner_size();
|
||||||
let surface_texture = SurfaceTexture::new(window_size.width, window_size.height, window);
|
let surface_texture = SurfaceTexture::new(window_size.width, window_size.height, window);
|
||||||
Pixels::new(width, height, surface_texture).unwrap()
|
// Pixels::new(width, height, surface_texture).unwrap()
|
||||||
|
PixelsBuilder::new(width, height, surface_texture)
|
||||||
|
.device_descriptor(wgpu::DeviceDescriptor {
|
||||||
|
limits: wgpu::Limits {
|
||||||
|
max_storage_textures_per_shader_stage: 4,
|
||||||
|
max_texture_dimension_2d: 4096,
|
||||||
|
max_texture_dimension_1d: 4096,
|
||||||
|
..wgpu::Limits::default()
|
||||||
|
},
|
||||||
|
..wgpu::DeviceDescriptor::default()
|
||||||
|
})
|
||||||
|
.enable_vsync(false)
|
||||||
|
.build()
|
||||||
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_window<T>(width: u32, height: u32, title: String, event_loop: &EventLoop<T>) -> Window {
|
pub fn create_window<T>(width: u32, height: u32, title: String, event_loop: &EventLoop<T>) -> Window {
|
||||||
|
Loading…
Reference in New Issue
Block a user