Skip to content

Commit

Permalink
Merge pull request #10 from aosoft/update-interfaces
Browse files Browse the repository at this point in the history
Update interfaces
  • Loading branch information
aosoft authored Aug 4, 2024
2 parents 4ce1d58 + ee6a257 commit db156e2
Show file tree
Hide file tree
Showing 16 changed files with 823 additions and 597 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ members = [
"unity-native-plugin-sample",
"unity-native-plugin-sample-profiler",
]
resolver = "2"

8 changes: 4 additions & 4 deletions unity-native-plugin-sample-profiler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "unity-native-plugin-sample-profiler"
version = "0.6.0"
version = "0.7.0"
authors = ["Yasuhiro Taniuchi"]
edition = "2018"
edition = "2021"
publish = false

[lib]
Expand All @@ -11,8 +11,8 @@ crate-type = ["cdylib"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
unity-native-plugin = { version = "0.6.0", path = "../unity-native-plugin", features = ["profiler_callbacks"] }
unity-native-plugin-sys = { version = "0.6.0", path = "../unity-native-plugin-sys" }
unity-native-plugin = { version = "0.7.0", path = "../unity-native-plugin", features = ["profiler_callbacks"] }
unity-native-plugin-sys = { version = "0.7.0", path = "../unity-native-plugin-sys" }
log = "0.4"
env_logger = "0.8"
flume = "0.10"
10 changes: 5 additions & 5 deletions unity-native-plugin-sample/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "unity-native-plugin-sample"
version = "0.6.0"
version = "0.7.0"
authors = ["Yasuhiro Taniuchi"]
edition = "2018"
edition = "2021"
publish = false

[lib]
Expand All @@ -11,10 +11,10 @@ crate-type = ["cdylib"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
unity-native-plugin = { version = "0.6.0", path = "../unity-native-plugin", features = ["d3d11", "d3d12", "profiler"] }
unity-native-plugin-vulkan = { version = "0.6.0", path = "../unity-native-plugin-vulkan" }
unity-native-plugin = { version = "0.7.0", path = "../unity-native-plugin", features = ["d3d11", "d3d12", "profiler"] }
unity-native-plugin-vulkan = { version = "0.7.0", path = "../unity-native-plugin-vulkan" }
winapi = { version = "0.3.9", features = ["winuser", "d3d11", "dxgiformat"] }
wio = "0.2.2"

[dev-dependencies]
unity-native-plugin-tester = { version = "0.6.0", path = "../unity-native-plugin-tester", features = ["d3d11"] }
unity-native-plugin-tester = { version = "0.7.0", path = "../unity-native-plugin-tester", features = ["d3d11"] }
4 changes: 2 additions & 2 deletions unity-native-plugin-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "unity-native-plugin-sys"
version = "0.6.0"
version = "0.7.0"
authors = ["Yasuhiro Taniuchi"]
edition = "2018"
edition = "2021"
license = "MIT"
description = "unity-native-plugin-sys"
homepage = "https://github.com/aosoft/unity-native-plugin-rs"
Expand Down
8 changes: 4 additions & 4 deletions unity-native-plugin-tester/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "unity-native-plugin-tester"
version = "0.6.0"
version = "0.7.0"
authors = ["Yasuhiro Taniuchi"]
edition = "2018"
edition = "2021"
license = "MIT"
description = "Unity Native Plugin API Tester Library"
homepage = "https://github.com/aosoft/unity-native-plugin-rs"
Expand All @@ -25,8 +25,8 @@ d3d11 = []
d3d12 = []

[dependencies]
unity-native-plugin-sys = { version = "0.6.0", path = "../unity-native-plugin-sys" }
unity-native-plugin = { version = "0.6.0", path = "../unity-native-plugin", features = ["d3d11", "d3d12"] }
unity-native-plugin-sys = { version = "0.7.0", path = "../unity-native-plugin-sys" }
unity-native-plugin = { version = "0.7.0", path = "../unity-native-plugin", features = ["d3d11", "d3d12"] }
winapi = { version = "0.3.9", features = ["winuser", "dxgi", "d3d11", "dxgiformat", "dxgitype", "d3dcommon"] }
winit = "0.23.0"
wio = "0.2.2"
Expand Down
18 changes: 11 additions & 7 deletions unity-native-plugin-tester/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,20 @@ extern "system" fn register_interface_split(
}

pub unsafe fn get_unity_interfaces() -> &'static mut TesterContextInterfaces {
UNITY_INTERFACES.as_mut().unwrap()
unsafe {
UNITY_INTERFACES.as_mut().unwrap()
}
}

pub unsafe fn get_unity_interface<T: UnityInterfaceBase + UnityInterfaceID>() -> &'static T {
get_unity_interfaces()
.get_interface(T::get_interface_guid())
.unwrap()
.as_any()
.downcast_ref::<T>()
.unwrap()
unsafe {
get_unity_interfaces()
.get_interface(T::get_interface_guid())
.unwrap()
.as_any()
.downcast_ref::<T>()
.unwrap()
}
}

pub fn initialize_unity_interfaces() {
Expand Down
8 changes: 4 additions & 4 deletions unity-native-plugin-vulkan/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "unity-native-plugin-vulkan"
version = "0.6.0"
version = "0.7.0"
authors = ["Yasuhiro Taniuchi"]
license = "MIT"
description = "Unity Native Plugin API (Vulkan) for Rust"
Expand All @@ -9,7 +9,7 @@ repository = "https://github.com/aosoft/unity-native-plugin-rs"
readme = "README.md"
categories = ["api-bindings", "game-engines"]
keywords = ["unity"]
edition = "2018"
edition = "2021"
include = [
"**/*.rs",
"Cargo.toml",
Expand All @@ -19,6 +19,6 @@ include = [
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
unity-native-plugin = { version = "0.6.0", path = "../unity-native-plugin" }
unity-native-plugin-sys = { version = "0.6.0", path = "../unity-native-plugin-sys" }
unity-native-plugin = { version = "0.7.0", path = "../unity-native-plugin" }
unity-native-plugin-sys = { version = "0.7.0", path = "../unity-native-plugin-sys" }
ash = "0.38.0+1.3.281.1"
Loading

0 comments on commit db156e2

Please sign in to comment.