Update all dependencies (#130)

This commit is contained in:
Jay Oster 2021-01-05 18:20:36 -08:00 committed by GitHub
parent efb64078ec
commit 0a893d6eff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 84 additions and 72 deletions

View file

@ -13,7 +13,7 @@ jobs:
rust:
- stable
- beta
- 1.41.0
- 1.43.0
steps:
- name: Checkout sources
uses: actions/checkout@v2
@ -40,7 +40,7 @@ jobs:
rust:
- stable
- beta
- 1.41.0
- 1.43.0
steps:
- name: Checkout sources
uses: actions/checkout@v2

View file

@ -22,12 +22,12 @@ include = [
pollster = "0.2"
raw-window-handle = "0.3"
thiserror = "1.0"
ultraviolet = "0.4"
ultraviolet = "0.7"
wgpu = "0.6"
[dev-dependencies]
pixels-mocks = { path = "internals/pixels-mocks" }
winit = "0.22"
winit = "0.24"
[workspace]
members = [

View file

@ -10,12 +10,12 @@ optimize = ["log/release_max_level_warn"]
default = ["optimize"]
[dependencies]
byteorder = "1.3.4"
env_logger = "0.7.1"
getrandom = "0.1.14"
line_drawing = "0.8.0"
log = "0.4.8"
byteorder = "1.3"
env_logger = "0.8"
getrandom = "0.2"
line_drawing = "0.8"
log = "0.4"
pixels = { path = "../.." }
randomize = "3.0.1"
winit = "0.22.0"
winit_input_helper = "0.6.0"
randomize = "3.0"
winit = "0.24"
winit_input_helper = "0.9"

View file

@ -42,7 +42,7 @@ fn main() -> Result<(), Error> {
// For everything else, for let winit_input_helper collect events to build its state.
// It returns `true` when it is time to update our game state and request a redraw.
if input.update(event) {
if input.update(&event) {
// Close events
if input.key_pressed(VirtualKeyCode::Escape) || input.quit() {
*control_flow = ControlFlow::Exit;
@ -150,13 +150,14 @@ fn create_window(
let width = SCREEN_WIDTH as f64;
let height = SCREEN_HEIGHT as f64;
let (monitor_width, monitor_height) = {
let size = window.current_monitor().size();
(
size.width as f64 / hidpi_factor,
size.height as f64 / hidpi_factor,
)
if let Some(monitor) = window.current_monitor() {
let size = monitor.size().to_logical(hidpi_factor);
(size.width, size.height)
} else {
(width, height)
}
};
let scale = (monitor_height / height * 2.0 / 3.0).round();
let scale = (monitor_height / height * 2.0 / 3.0).round().max(1.0);
// Resize, center, and display the window
let min_size: winit::dpi::LogicalSize<f64> =

View file

@ -10,8 +10,8 @@ optimize = ["log/release_max_level_warn"]
default = ["optimize"]
[dependencies]
env_logger = "0.7.1"
log = "0.4.8"
env_logger = "0.8"
log = "0.4"
pixels = { path = "../.." }
winit = "0.22.0"
winit_input_helper = "0.6.0"
winit = "0.24"
winit_input_helper = "0.9"

View file

@ -72,7 +72,7 @@ fn main() -> Result<(), Error> {
}
// Handle input events
if input.update(event) {
if input.update(&event) {
// Close events
if input.key_pressed(VirtualKeyCode::Escape) || input.quit() {
*control_flow = ControlFlow::Exit;

View file

@ -10,11 +10,11 @@ optimize = ["log/release_max_level_warn"]
default = ["optimize"]
[dependencies]
env_logger = "0.7"
imgui = "0.4"
imgui-wgpu = "0.9"
imgui-winit-support = { version = "0.4", default-features = false, features = ["winit-22"] }
env_logger = "0.8"
imgui = "0.6"
imgui-wgpu = "0.12"
imgui-winit-support = "0.6"
log = "0.4"
pixels = { path = "../.." }
winit = "0.22"
winit_input_helper = "0.6"
winit = "0.24"
winit_input_helper = "0.9"

View file

@ -22,7 +22,7 @@ impl Gui {
let mut platform = imgui_winit_support::WinitPlatform::init(&mut imgui);
platform.attach_window(
imgui.io_mut(),
&window,
window,
imgui_winit_support::HiDpiMode::Default,
);
@ -51,7 +51,11 @@ impl Gui {
let device = pixels.device();
let queue = pixels.queue();
let texture_format = wgpu::TextureFormat::Bgra8UnormSrgb;
let renderer = imgui_wgpu::Renderer::new(&mut imgui, &device, &queue, texture_format);
let config = imgui_wgpu::RendererConfig {
texture_format,
..Default::default()
};
let renderer = imgui_wgpu::Renderer::new(&mut imgui, &device, &queue, config);
// Return GUI context
Self {
@ -70,9 +74,10 @@ impl Gui {
window: &winit::window::Window,
) -> Result<(), winit::error::ExternalError> {
// Prepare Dear ImGui
let io = self.imgui.io_mut();
self.last_frame = io.update_delta_time(self.last_frame);
self.platform.prepare_frame(io, window)
let now = Instant::now();
self.imgui.io_mut().update_delta_time(now - self.last_frame);
self.last_frame = now;
self.platform.prepare_frame(self.imgui.io_mut(), window)
}
/// Render Dear ImGui.

View file

@ -79,7 +79,7 @@ fn main() -> Result<(), Error> {
// Handle input events
gui.handle_event(&window, &event);
if input.update(event) {
if input.update(&event) {
// Close events
if input.key_pressed(VirtualKeyCode::Escape) || input.quit() {
*control_flow = ControlFlow::Exit;
@ -124,7 +124,7 @@ impl World {
/// Draw the `World` state to the frame buffer.
///
/// Assumes the default texture format: [`wgpu::TextureFormat::Rgba8UnormSrgb`]
/// Assumes the default texture format: `wgpu::TextureFormat::Rgba8UnormSrgb`
fn draw(&self, frame: &mut [u8]) {
for (i, pixel) in frame.chunks_exact_mut(4).enumerate() {
let x = (i % WIDTH as usize) as i16;

View file

@ -10,13 +10,13 @@ optimize = ["log/release_max_level_warn"]
default = ["optimize"]
[dependencies]
byteorder = "1.3.4"
env_logger = "0.7.1"
getrandom = "0.1.14"
gilrs = "0.7.4"
log = "0.4.8"
byteorder = "1.3"
env_logger = "0.8"
getrandom = "0.2"
gilrs = "0.8"
log = "0.4"
pixels = { path = "../.." }
randomize = "3.0.1"
randomize = "3.0"
simple-invaders = { path = "simple-invaders" }
winit = "0.22.0"
winit_input_helper = "0.6.0"
winit = "0.24"
winit_input_helper = "0.9"

View file

@ -11,4 +11,4 @@ randomize = "3.0"
[dev-dependencies]
byteorder = "1.3"
getrandom = "0.1"
getrandom = "0.2"

View file

@ -60,7 +60,7 @@ fn main() -> Result<(), Error> {
// For everything else, for let winit_input_helper collect events to build its state.
// It returns `true` when it is time to update our game state and request a redraw.
if input.update(event) {
if input.update(&event) {
// Close events
if input.key_pressed(VirtualKeyCode::Escape) || input.quit() {
*control_flow = ControlFlow::Exit;
@ -142,13 +142,14 @@ fn create_window(
let width = SCREEN_WIDTH as f64;
let height = SCREEN_HEIGHT as f64;
let (monitor_width, monitor_height) = {
let size = window.current_monitor().size();
(
size.width as f64 / hidpi_factor,
size.height as f64 / hidpi_factor,
)
if let Some(monitor) = window.current_monitor() {
let size = monitor.size().to_logical(hidpi_factor);
(size.width, size.height)
} else {
(width, height)
}
};
let scale = (monitor_height / height * 2.0 / 3.0).round();
let scale = (monitor_height / height * 2.0 / 3.0).round().max(1.0);
// Resize, center, and display the window
let min_size = PhysicalSize::new(width, height).to_logical::<f64>(hidpi_factor);

View file

@ -86,7 +86,7 @@ impl World {
/// Draw the `World` state to the frame buffer.
///
/// Assumes the default texture format: [`wgpu::TextureFormat::Rgba8UnormSrgb`]
/// Assumes the default texture format: `wgpu::TextureFormat::Rgba8UnormSrgb`
fn draw(&self, frame: &mut [u8]) {
for (i, pixel) in frame.chunks_exact_mut(4).enumerate() {
let x = (i % WIDTH as usize) as i16;

View file

@ -10,8 +10,8 @@ optimize = ["log/release_max_level_warn"]
default = ["optimize"]
[dependencies]
env_logger = "0.7.1"
log = "0.4.8"
env_logger = "0.7"
log = "0.4"
pixels = { path = "../.." }
winit = "0.22.0"
winit_input_helper = "0.6.0"
winit = "0.24"
winit_input_helper = "0.9"

View file

@ -57,7 +57,7 @@ fn main() -> Result<(), Error> {
}
// Handle input events
if input.update(event) {
if input.update(&event) {
// Close events
if input.key_pressed(VirtualKeyCode::Escape) || input.quit() {
*control_flow = ControlFlow::Exit;
@ -102,7 +102,7 @@ impl World {
/// Draw the `World` state to the frame buffer.
///
/// Assumes the default texture format: [`wgpu::TextureFormat::Rgba8UnormSrgb`]
/// Assumes the default texture format: `wgpu::TextureFormat::Rgba8UnormSrgb`
fn draw(&self, frame: &mut [u8]) {
for (i, pixel) in frame.chunks_exact_mut(4).enumerate() {
let x = (i % WIDTH as usize) as i16;

View file

@ -10,10 +10,10 @@ optimize = ["log/release_max_level_warn"]
default = ["optimize"]
[dependencies]
env_logger = "0.7"
euclid = "0.20"
env_logger = "0.8"
euclid = "0.22"
log = "0.4"
pixels = { path = "../.." }
raqote = { version = "0.8", default-features = false }
winit = "0.22"
winit_input_helper = "0.6"
raqote = { git = "https://github.com/jrmuizel/raqote.git", rev = "74f0afa2be54561c1a9928e885ab95e8a4c5322d", default-features = false }
winit = "0.24"
winit_input_helper = "0.9"

View file

@ -67,7 +67,7 @@ fn main() -> Result<(), Error> {
}
// Handle input events
if input.update(event) {
if input.update(&event) {
// Close events
if input.key_pressed(VirtualKeyCode::Escape) || input.quit() {
*control_flow = ControlFlow::Exit;

View file

@ -55,9 +55,14 @@ impl Shapes {
a: 0xff,
});
self.t1 = self.t1.post_translate(Vector2D::new(-self.cx, -self.cy));
self.t1 = self.t1.post_rotate(Angle { radians: delta });
self.t1 = self.t1.post_translate(Vector2D::new(self.cx, self.cy));
let translate = Vector2D::new(-self.cx, -self.cy).to_transform();
let inv_translate = translate
.inverse()
.unwrap_or_else(|| Vector2D::new(self.cx, self.cy).to_transform());
self.t1 = self.t1.then(&translate);
self.t1 = self.t1.then_rotate(Angle::radians(delta));
self.t1 = self.t1.then(&inv_translate);
self.dt.set_transform(&self.t1);
let mut pb = PathBuilder::new();
@ -91,9 +96,9 @@ impl Shapes {
);
self.dt.fill(&path, &gradient, &DrawOptions::new());
self.t2 = self.t2.post_translate(Vector2D::new(-self.cx, -self.cy));
self.t2 = self.t2.post_rotate(Angle { radians: -delta });
self.t2 = self.t2.post_translate(Vector2D::new(self.cx, self.cy));
self.t2 = self.t2.then(&translate);
self.t2 = self.t2.then_rotate(Angle::radians(-delta));
self.t2 = self.t2.then(&inv_translate);
self.dt.set_transform(&self.t2);
let mut pb = PathBuilder::new();