Skip to content

Commit

Permalink
- fixed all warnings from win32 update, fixed issue with imgui, test …
Browse files Browse the repository at this point in the history
…no quite running smoothly with stack buffer overrun
  • Loading branch information
GBDixonAlex committed Nov 12, 2024
1 parent 3dd0806 commit 3e04533
Show file tree
Hide file tree
Showing 4 changed files with 201 additions and 173 deletions.
2 changes: 1 addition & 1 deletion src/av/wmf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl super::VideoPlayer<d3d12::Device> for VideoPlayer {

// make thread safe
let mt : ID3D11Multithread = device.cast()?;
mt.SetMultithreadProtected(BOOL::from(true));
mt.SetMultithreadProtected(BOOL::from(true)).expect("hotline_rs::wmf::error: call to SetMultithreadProtected failed");

// setup media engine
let mut reset_token : u32 = 0;
Expand Down
9 changes: 4 additions & 5 deletions src/gfx/d3d12.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ use std::sync::Mutex;
use windows::{
core::*, Win32::Foundation::*, Win32::Graphics::Direct3D::Fxc::*, Win32::Graphics::Direct3D::*,
Win32::Graphics::Direct3D12::*, Win32::Graphics::Dxgi::Common::*, Win32::Graphics::Dxgi::*,
Win32::System::LibraryLoader::*, Win32::System::Threading::*,
Win32::System::WindowsProgramming::*,
Win32::System::LibraryLoader::*, Win32::System::Threading::*
};

#[macro_export]
Expand Down Expand Up @@ -856,7 +855,7 @@ pub fn get_hardware_adapter(
break;
}

let mut desc = adapter.unwrap().GetDesc1()?;
let desc = adapter.unwrap().GetDesc1()?;

// decode utf-16 dfescription
let decoded1 = decode_utf16(desc.Description)
Expand Down Expand Up @@ -890,7 +889,7 @@ pub fn get_hardware_adapter(

let adapter = factory.EnumAdapters1(selected_index as u32)?;

let mut desc = adapter.GetDesc1()?;
let desc = adapter.GetDesc1()?;

if D3D12CreateDevice(
&adapter,
Expand Down Expand Up @@ -1748,7 +1747,7 @@ impl super::Device for Device {
..Default::default()
};

let hwnd : HWND = unsafe { std::mem::transmute(win.get_native_handle().get_isize()) };
let hwnd : HWND = std::mem::transmute(win.get_native_handle().get_isize());

// create swap chain itself
let swap_chain1 = self
Expand Down
Loading

0 comments on commit 3e04533

Please sign in to comment.