-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
110 additions
and
100 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,58 +1 @@ | ||
use futures::executor; | ||
use raw_window_handle::{ | ||
AppKitDisplayHandle, AppKitWindowHandle, HasRawDisplayHandle, HasRawWindowHandle, | ||
RawDisplayHandle, RawWindowHandle, | ||
}; | ||
use std::ffi; | ||
|
||
mod render; | ||
|
||
pub use render::render::State; | ||
|
||
mod capture; | ||
|
||
#[no_mangle] | ||
pub extern "C" fn send_window(app_kit_nsview: *mut ffi::c_void) { | ||
let window = Window { | ||
ns_view: app_kit_nsview, | ||
}; | ||
|
||
let res = State::new(&window); | ||
let mut v = executor::block_on(res); | ||
|
||
v.render(); | ||
} | ||
|
||
pub fn send_raw_window< | ||
W: raw_window_handle::HasRawWindowHandle + raw_window_handle::HasRawDisplayHandle, | ||
>( | ||
window: &W, | ||
) { | ||
//capture::do_capture(); | ||
|
||
let res = State::new(&window); | ||
let mut v = executor::block_on(res); | ||
|
||
v.render(); | ||
} | ||
|
||
pub struct Window { | ||
//id: usize, | ||
// ns_window: *mut ffi::c_void, | ||
ns_view: *mut ffi::c_void, | ||
} | ||
|
||
unsafe impl HasRawDisplayHandle for Window { | ||
fn raw_display_handle(&self) -> RawDisplayHandle { | ||
RawDisplayHandle::AppKit(AppKitDisplayHandle::empty()) | ||
} | ||
} | ||
|
||
unsafe impl HasRawWindowHandle for Window { | ||
fn raw_window_handle(&self) -> RawWindowHandle { | ||
let mut handle = AppKitWindowHandle::empty(); | ||
// handle.ns_window = self.ns_window; | ||
handle.ns_view = self.ns_view; | ||
RawWindowHandle::AppKit(handle) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
[workspace] | ||
|
||
members = [ | ||
"Cappy3ds", | ||
"cappy3ds", | ||
"cappy3ds_render", | ||
"simple_win" | ||
] | ||
] |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
cargo build -p cappy3ds | ||
cp ./target/debug/libcappy3ds.dylib ./macos/ | ||
cbindgen --config ./Cappy3ds/cbindgen.toml --lang c --crate cappy3ds --output ./bindings.h | ||
cargo build -p cappy3ds_render | ||
cp ./target/debug/libcappy3ds_render.dylib ./macos/ | ||
cbindgen --config ./cappy3ds_render/cbindgen.toml --lang c --crate cappy3ds_render --output ./bindings.h |
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,19 @@ | ||
[package] | ||
name = "cappy3ds_render" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
bytemuck = { version = "1.14", features = [ "derive" ] } | ||
env_logger = "0.10" | ||
log = "0.4" | ||
wgpu = "0.17" | ||
raw-window-handle = "0.5.2" | ||
image = "0.24.7" | ||
futures = "0.3.28" | ||
|
||
[lib] | ||
name = "cappy3ds_render" | ||
crate-type = ["staticlib", "cdylib", "lib"] |
File renamed without changes.
File renamed without changes
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,57 @@ | ||
use futures::executor; | ||
use raw_window_handle::{ | ||
AppKitDisplayHandle, AppKitWindowHandle, HasRawDisplayHandle, HasRawWindowHandle, | ||
RawDisplayHandle, RawWindowHandle, | ||
}; | ||
use std::ffi; | ||
|
||
mod render; | ||
|
||
pub use render::State; | ||
|
||
|
||
#[no_mangle] | ||
pub extern "C" fn send_window(app_kit_nsview: *mut ffi::c_void) { | ||
let window = Window { | ||
ns_view: app_kit_nsview, | ||
}; | ||
|
||
let res = State::new(&window); | ||
let mut v = executor::block_on(res); | ||
|
||
v.render(); | ||
} | ||
|
||
pub fn send_raw_window< | ||
W: raw_window_handle::HasRawWindowHandle + raw_window_handle::HasRawDisplayHandle, | ||
>( | ||
window: &W, | ||
) { | ||
//capture::do_capture(); | ||
|
||
let res = State::new(&window); | ||
let mut v = executor::block_on(res); | ||
|
||
v.render(); | ||
} | ||
|
||
pub struct Window { | ||
//id: usize, | ||
// ns_window: *mut ffi::c_void, | ||
ns_view: *mut ffi::c_void, | ||
} | ||
|
||
unsafe impl HasRawDisplayHandle for Window { | ||
fn raw_display_handle(&self) -> RawDisplayHandle { | ||
RawDisplayHandle::AppKit(AppKitDisplayHandle::empty()) | ||
} | ||
} | ||
|
||
unsafe impl HasRawWindowHandle for Window { | ||
fn raw_window_handle(&self) -> RawWindowHandle { | ||
let mut handle = AppKitWindowHandle::empty(); | ||
// handle.ns_window = self.ns_window; | ||
handle.ns_view = self.ns_view; | ||
RawWindowHandle::AppKit(handle) | ||
} | ||
} |
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
File renamed without changes.
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