mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-04-15 04:14:07 +00:00
examples: Update to windows 0.61 / windows-numerics 0.2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1695>
This commit is contained in:
parent
c8d752affc
commit
86d998336a
4 changed files with 28 additions and 21 deletions
28
Cargo.lock
generated
28
Cargo.lock
generated
|
@ -2951,9 +2951,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "windows"
|
||||
version = "0.60.0"
|
||||
version = "0.61.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ddf874e74c7a99773e62b1c671427abf01a425e77c3d3fb9fb1e4883ea934529"
|
||||
checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419"
|
||||
dependencies = [
|
||||
"windows-collections",
|
||||
"windows-core",
|
||||
|
@ -2964,18 +2964,18 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "windows-collections"
|
||||
version = "0.1.1"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5467f79cc1ba3f52ebb2ed41dbb459b8e7db636cc3429458d9a852e15bc24dec"
|
||||
checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8"
|
||||
dependencies = [
|
||||
"windows-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-core"
|
||||
version = "0.60.1"
|
||||
version = "0.61.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ca21a92a9cae9bf4ccae5cf8368dce0837100ddf6e6d57936749e85f152f6247"
|
||||
checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980"
|
||||
dependencies = [
|
||||
"windows-implement",
|
||||
"windows-interface",
|
||||
|
@ -2986,9 +2986,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "windows-future"
|
||||
version = "0.1.1"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a787db4595e7eb80239b74ce8babfb1363d8e343ab072f2ffe901400c03349f0"
|
||||
checksum = "7a1d6bbefcb7b60acd19828e1bc965da6fcf18a7e39490c5f8be71e54a19ba32"
|
||||
dependencies = [
|
||||
"windows-core",
|
||||
"windows-link",
|
||||
|
@ -2996,9 +2996,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "windows-implement"
|
||||
version = "0.59.0"
|
||||
version = "0.60.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1"
|
||||
checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -3024,9 +3024,9 @@ checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
|
|||
|
||||
[[package]]
|
||||
name = "windows-numerics"
|
||||
version = "0.1.1"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "005dea54e2f6499f2cee279b8f703b3cf3b5734a2d8d21867c8f44003182eeed"
|
||||
checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
|
||||
dependencies = [
|
||||
"windows-core",
|
||||
"windows-link",
|
||||
|
@ -3043,9 +3043,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "windows-strings"
|
||||
version = "0.3.1"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319"
|
||||
checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97"
|
||||
dependencies = [
|
||||
"windows-link",
|
||||
]
|
||||
|
|
|
@ -45,12 +45,12 @@ atomic_refcell = "0.1"
|
|||
data-encoding = "2.0"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
windows = { version = "0.60", features=["Win32_Graphics_Direct3D11",
|
||||
windows = { version = "0.61", features=["Win32_Graphics_Direct3D11",
|
||||
"Win32_Foundation", "Win32_Graphics_Direct3D", "Win32_Graphics_Dxgi",
|
||||
"Win32_Graphics_Dxgi_Common", "Win32_Graphics_Direct2D",
|
||||
"Win32_Graphics_Direct2D_Common", "Win32_Graphics_DirectWrite",
|
||||
"Win32_Graphics_Imaging", "Win32_System_Com", "Foundation_Numerics"], optional = true }
|
||||
windows-numerics = "0.1"
|
||||
windows-numerics = "0.2"
|
||||
glutin = { version = "0.32", features = ["wgl"] }
|
||||
glutin-winit = { version = "0.5", features = ["wgl"] }
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ use windows::{
|
|||
Dxgi::{Common::*, *},
|
||||
},
|
||||
};
|
||||
use windows_numerics::*;
|
||||
|
||||
struct OverlayContext {
|
||||
d2d_factory: ID2D1Factory,
|
||||
|
@ -288,7 +289,7 @@ fn main() -> Result<()> {
|
|||
|
||||
// Then, renders text
|
||||
render_target.DrawTextLayout(
|
||||
D2D_POINT_2F { x: 0f32, y: 0f32 },
|
||||
Vector2 { X: 0f32, Y: 0f32 },
|
||||
context.text_layout.as_ref(),
|
||||
&text_brush,
|
||||
D2D1_DRAW_TEXT_OPTIONS_NONE,
|
||||
|
|
|
@ -182,12 +182,18 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
|
|||
.unwrap();
|
||||
|
||||
let angle = (angle + global_angle) as f32;
|
||||
let matrix = Matrix3x2::rotation(angle, center_x, center_y);
|
||||
let matrix = Matrix3x2::rotation_around(
|
||||
angle,
|
||||
Vector2 {
|
||||
X: center_x,
|
||||
Y: center_y,
|
||||
},
|
||||
);
|
||||
render_target.SetTransform(&matrix);
|
||||
render_target.DrawTextLayout(
|
||||
D2D_POINT_2F {
|
||||
x: 0f32,
|
||||
y: top_margin,
|
||||
Vector2 {
|
||||
X: 0f32,
|
||||
Y: top_margin,
|
||||
},
|
||||
text_layout,
|
||||
&text_brush,
|
||||
|
|
Loading…
Reference in a new issue