Make size/position types generic over pixel type (#1277)

* Begin implementing DPI generics

* Fix multithreaded example

* Format

* Fix serde test

* hopefully fix most of the errors

* Fix dpi module errors

* More error fixings

* Format

* fix macos errors

* Another error pass

* Replace bad type signatures

* more fixins
This commit is contained in:
Osspial 2020-01-04 01:33:07 -05:00
parent b16042a047
commit 3a1e694c2f
40 changed files with 388 additions and 336 deletions

View file

@ -62,7 +62,7 @@ impl std::fmt::Debug for VideoMode {
}
impl VideoMode {
pub fn size(&self) -> PhysicalSize {
pub fn size(&self) -> PhysicalSize<u32> {
self.size.into()
}
@ -185,7 +185,7 @@ impl MonitorHandle {
}
#[inline]
pub fn size(&self) -> PhysicalSize {
pub fn size(&self) -> PhysicalSize<u32> {
let monitor_info = get_monitor_info(self.0).unwrap();
PhysicalSize {
width: (monitor_info.rcMonitor.right - monitor_info.rcMonitor.left) as u32,
@ -194,11 +194,11 @@ impl MonitorHandle {
}
#[inline]
pub fn position(&self) -> PhysicalPosition {
pub fn position(&self) -> PhysicalPosition<i32> {
let monitor_info = get_monitor_info(self.0).unwrap();
PhysicalPosition {
x: monitor_info.rcMonitor.left as f64,
y: monitor_info.rcMonitor.top as f64,
x: monitor_info.rcMonitor.left,
y: monitor_info.rcMonitor.top,
}
}