-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modified: Cargo.lock modified: Cargo.toml modified: README.md new file: src/buffer.rs modified: src/capture.rs modified: src/d3d11.rs modified: src/frame.rs new file: src/graphics_capture_api.rs modified: src/lib.rs modified: src/monitor.rs new file: src/settings.rs modified: src/window.rs
- Loading branch information
1 parent
2393e9c
commit f200b66
Showing
12 changed files
with
1,090 additions
and
595 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use std::alloc::Layout; | ||
|
||
/// To Send Raw Pointers Between Threads | ||
pub struct SendPtr<T>(pub *mut T); | ||
|
||
impl<T> SendPtr<T> { | ||
pub fn new(ptr: *mut T) -> Self { | ||
Self(ptr) | ||
} | ||
} | ||
|
||
unsafe impl<T> Send for SendPtr<T> {} | ||
|
||
/// To Save Pointer And It's Layout Together | ||
pub struct Buffer { | ||
pub ptr: *mut u8, | ||
pub layout: Layout, | ||
} | ||
|
||
impl Buffer { | ||
pub const fn new(ptr: *mut u8, layout: Layout) -> Self { | ||
Self { ptr, layout } | ||
} | ||
} |
Oops, something went wrong.