Skip to content

Commit eb5de06

Browse files
committed
Rename D3DVisual to AngleVisual
1 parent f942806 commit eb5de06

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

direct-composition/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl DirectComposition {
9999
}
100100
}
101101

102-
pub fn create_d3d_visual(&self, width: u32, height: u32) -> D3DVisual {
102+
pub fn create_angle_visual(&self, width: u32, height: u32) -> AngleVisual {
103103
unsafe {
104104
let desc = DXGI_SWAP_CHAIN_DESC1 {
105105
Width: width,
@@ -135,20 +135,20 @@ impl DirectComposition {
135135
visual.SetContent(&*****swap_chain).check_hresult();
136136
self.root_visual.AddVisual(&*visual, FALSE, ptr::null_mut()).check_hresult();
137137

138-
D3DVisual { visual, swap_chain, egl, gleam }
138+
AngleVisual { visual, swap_chain, egl, gleam }
139139
}
140140
}
141141
}
142142

143143
/// A DirectComposition "visual" configured for rendering with Direct3D.
144-
pub struct D3DVisual {
144+
pub struct AngleVisual {
145145
visual: ComPtr<IDCompositionVisual>,
146146
swap_chain: ComPtr<winapi::shared::dxgi1_2::IDXGISwapChain1>,
147147
egl: egl::PerVisualEglThings,
148148
pub gleam: Rc<gleam::gl::Gl>,
149149
}
150150

151-
impl D3DVisual {
151+
impl AngleVisual {
152152
pub fn set_offset_x(&self, offset_x: f32) {
153153
unsafe {
154154
self.visual.SetOffsetX_1(offset_x).check_hresult()

direct-composition/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extern crate gleam;
66
extern crate webrender;
77
extern crate winit;
88

9-
use direct_composition::{DirectComposition, D3DVisual};
9+
use direct_composition::{DirectComposition, AngleVisual};
1010
use winit::os::windows::WindowExt;
1111

1212
fn main() {
@@ -25,11 +25,11 @@ fn main() {
2525
webrender::RendererOptions::default(),
2626
).unwrap();
2727

28-
let visual1 = composition.create_d3d_visual(300, 200);
28+
let visual1 = composition.create_angle_visual(300, 200);
2929
visual1.set_offset_x(100.);
3030
visual1.set_offset_y(50.);
3131

32-
let visual2 = composition.create_d3d_visual(400, 300);
32+
let visual2 = composition.create_angle_visual(400, 300);
3333
let mut offset_y = 100.;
3434
visual2.set_offset_x(200.);
3535
visual2.set_offset_y(offset_y);
@@ -89,7 +89,7 @@ fn direct_composition_from_window(window: &winit::Window) -> DirectComposition {
8989
}
9090
}
9191

92-
fn render_plain_rgba_frame(visual: &D3DVisual, &(r, g, b, a): &(f32, f32, f32, f32)) {
92+
fn render_plain_rgba_frame(visual: &AngleVisual, &(r, g, b, a): &(f32, f32, f32, f32)) {
9393
visual.make_current();
9494
visual.gleam.clear_color(r, g, b, a);
9595
visual.gleam.clear(gleam::gl::COLOR_BUFFER_BIT);

0 commit comments

Comments
 (0)