mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2024-12-23 11:21:30 +11:00
windows: use c_void from winapi (#235)
The `SelectObject()` call accepts a `HGDIOBJ` which is typecast to a `std::os::raw::c_void` when building using libstd, and is its own thing when building with std disabled: winapi/0.3.9/src/winapi/lib.rs.html: #[cfg(feature = "std")] pub use std::os::raw::c_void; #[cfg(not(feature = "std"))] pub enum c_void {} This patch uses `HGDIOBJ` as the typecast as necessary. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
655e437346
commit
e5b5cc50d5
|
@ -279,7 +279,7 @@ unsafe extern "system" fn wnd_proc(
|
|||
let mut y_offset = 0;
|
||||
|
||||
let dc = wnd.dc.unwrap();
|
||||
wingdi::SelectObject(dc, wnd.clear_brush as *mut std::ffi::c_void);
|
||||
wingdi::SelectObject(dc, wnd.clear_brush as *mut winapi::ctypes::c_void);
|
||||
|
||||
match wnd.draw_params.scale_mode {
|
||||
ScaleMode::AspectRatioStretch => {
|
||||
|
@ -817,7 +817,7 @@ impl Window {
|
|||
|
||||
pub fn set_background_color(&mut self, color: u32) {
|
||||
unsafe {
|
||||
wingdi::DeleteObject(self.clear_brush as *mut std::ffi::c_void);
|
||||
wingdi::DeleteObject(self.clear_brush as *mut winapi::ctypes::c_void);
|
||||
let r = (color >> 16) & 0xff;
|
||||
let g = (color >> 8) & 0xff;
|
||||
let b = (color >> 0) & 0xff;
|
||||
|
|
Loading…
Reference in a new issue