Skip to content

Commit

Permalink
Use PhysicalSize on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
markusmoenig committed Oct 30, 2022
1 parent fdd5f44 commit 4f35273
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions creator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use prelude::*;

use log::error;
use pixels::{Error, Pixels, SurfaceTexture};
use winit::dpi::LogicalSize;
use winit::dpi::{LogicalSize, PhysicalSize};
use winit::event::{Event, DeviceEvent, WindowEvent};
use winit::event_loop::{ControlFlow, EventLoop};
use winit::window::WindowBuilder;
Expand All @@ -74,15 +74,26 @@ fn main() -> Result<(), Error> {
let event_loop = EventLoop::new();
let mut input = WinitInputHelper::new();
let window = {
let size = LogicalSize::new(width as f64, height as f64);

if cfg!(target_os = "macos") {
let size = LogicalSize::new(width as f64, height as f64);
WindowBuilder::new()
.with_title("Eldiron")
.with_inner_size(size)
.with_min_inner_size(size)

WindowBuilder::new()
.with_title("Eldiron Creator")
.build(&event_loop)
.unwrap()
} else {
let size = PhysicalSize::new(width as f64, height as f64);
WindowBuilder::new()
.with_title("Eldiron")
.with_inner_size(size)
.with_min_inner_size(size)

.build(&event_loop)
.unwrap()
}
};

let mut pixels = {
Expand Down

0 comments on commit 4f35273

Please sign in to comment.