Universal library for discovering common render engines functions. Supports DirectX9 (D3D9), DirectX10 (D3D10), DirectX11 (D3D11), DirectX12 (D3D12), OpenGL, Vulkan. Currently only supports Windows, but OpenGL and Vulkan are candidates for making cross platform.
Provide access to common render engine functions so that they can be hooked/augmented. For instance the DirectX9 EndScene hook, DirectX11 Present Hook, and OpenGL wglSwapBuffers hook.
In your cargo.toml
specify the shroud dependency and the render engines you would like access to as feature flags.
By default all render engines are enabled, which you probably do not need.
For example targeting a DirectX9 Host/Game
Toml
[dependencies]
shroud = { version = "0.1.1", default-features = false, features = ["directx9"] }
And targeting a DirectX12 Host/Game..
Toml
[dependencies]
shroud = { version = "0.1.1", default-features = false, features = ["directx12"] }
The example code compiled as a dll and injected provides the results you see in the below demos. ```Rust // use shroud::directx::directx9; // use shroud::directx::directx10; // use shroud::directx::directx11; // use shroud::opengl; // use shroud::vulkan; use shroud::directx::directx12;
use winapi::shared::minwindef::{BOOL, DWORD, HINSTANCE, LPVOID, TRUE}; use winapi::um::consoleapi::AllocConsole; use winapi::um::winnt::DLLPROCESSATTACH;
unsafe extern "system" fn dllattach(base: LPVOID) -> u32 { AllocConsole();
// match directx9::methods
// match directx10::methods
// match directx11::methods
// match opengl::methods
// match vulkan::methods
match directx12::methods() {
Ok(methods) => {
println!("{:#?}", methods);
}
Err(err) => {
println!("Error on Methods Find: {:?}", err);
}
}
0
}
// Dll Entry Function, immediately spawn thread and do our business else where
pub unsafe extern "system" fn DllMain( module: HINSTANCE, callreason: DWORD, _reserved: LPVOID, ) -> BOOL { if callreason == DLLPROCESSATTACH { winapi::um::processthreadsapi::CreateThread( std::ptr::nullmut(), 0, Some(dllattach), module as , 0, std::ptr::nullmut(), );
TRUE
} else {
TRUE
}
} ```
Todo...
Todo...