Skip to content

Commit 61a3414

Browse files
committed
Let snake case conversion for Direct3D11 match namespace/module name
1 parent daf020e commit 61a3414

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

Generator/NameHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static string FirstToLower(string name)
2323
}
2424

2525
static Regex CaseConversionExceptionsRegex = new Regex(
26-
"(Base64|Float32|Float64|DBm|UInt|SInt|SFloat|Direct3D|VCard|OAuth|CData|ESim|MPeg|WMAudio|URLs|EFSpn|EFOns|EFOpl|EFPnn|ETag|IndexedDB|JavaScript|HResult|UIElement|IMediaSource|IAnimationObject|IBuffer)" +
26+
"(Base64|Float32|Float64|DBm|UInt|SInt|SFloat|Direct3D11|Direct3D|VCard|OAuth|CData|ESim|MPeg|WMAudio|URLs|EFSpn|EFOns|EFOpl|EFPnn|ETag|IndexedDB|JavaScript|HResult|UIElement|IMediaSource|IAnimationObject|IBuffer)" +
2727
"([A-Z0-9_]|$)", RegexOptions.Compiled);
2828

2929
public static string CamelToSnakeCase(string name)

src/rt/gen/windows/ai.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl ILearningModelDevice {
194194
let hr = ((*self.lpVtbl).get_AdapterId)(self as *const _ as *mut _, &mut out);
195195
if hr == S_OK { Ok(out) } else { err(hr) }
196196
}}
197-
#[cfg(feature="windows-graphics")] #[inline] pub fn get_direct3d_11_device(&self) -> Result<Option<ComPtr<super::super::graphics::directx::direct3d11::IDirect3DDevice>>> { unsafe {
197+
#[cfg(feature="windows-graphics")] #[inline] pub fn get_direct3d11_device(&self) -> Result<Option<ComPtr<super::super::graphics::directx::direct3d11::IDirect3DDevice>>> { unsafe {
198198
let mut out = null_mut();
199199
let hr = ((*self.lpVtbl).get_Direct3D11Device)(self as *const _ as *mut _, &mut out);
200200
if hr == S_OK { Ok(ComPtr::wrap_optional(out)) } else { err(hr) }
@@ -207,8 +207,8 @@ impl LearningModelDevice {
207207
#[inline] pub fn create(deviceKind: LearningModelDeviceKind) -> Result<ComPtr<LearningModelDevice>> {
208208
<Self as RtActivatable<ILearningModelDeviceFactory>>::get_activation_factory().create(deviceKind)
209209
}
210-
#[cfg(feature="windows-graphics")] #[inline] pub fn create_from_direct3d_11_device(device: &super::super::graphics::directx::direct3d11::IDirect3DDevice) -> Result<Option<ComPtr<LearningModelDevice>>> {
211-
<Self as RtActivatable<ILearningModelDeviceStatics>>::get_activation_factory().create_from_direct3d_11_device(device)
210+
#[cfg(feature="windows-graphics")] #[inline] pub fn create_from_direct3d11_device(device: &super::super::graphics::directx::direct3d11::IDirect3DDevice) -> Result<Option<ComPtr<LearningModelDevice>>> {
211+
<Self as RtActivatable<ILearningModelDeviceStatics>>::get_activation_factory().create_from_direct3d11_device(device)
212212
}
213213
}
214214
DEFINE_CLSID!(LearningModelDevice(&[87,105,110,100,111,119,115,46,65,73,46,77,97,99,104,105,110,101,76,101,97,114,110,105,110,103,46,76,101,97,114,110,105,110,103,77,111,100,101,108,68,101,118,105,99,101,0]) [CLSID_LearningModelDevice]);
@@ -231,7 +231,7 @@ RT_INTERFACE!{static interface ILearningModelDeviceStatics(ILearningModelDeviceS
231231
#[cfg(feature="windows-graphics")] fn CreateFromDirect3D11Device(&self, device: *mut super::super::graphics::directx::direct3d11::IDirect3DDevice, out: *mut *mut LearningModelDevice) -> HRESULT
232232
}}
233233
impl ILearningModelDeviceStatics {
234-
#[cfg(feature="windows-graphics")] #[inline] pub fn create_from_direct3d_11_device(&self, device: &super::super::graphics::directx::direct3d11::IDirect3DDevice) -> Result<Option<ComPtr<LearningModelDevice>>> { unsafe {
234+
#[cfg(feature="windows-graphics")] #[inline] pub fn create_from_direct3d11_device(&self, device: &super::super::graphics::directx::direct3d11::IDirect3DDevice) -> Result<Option<ComPtr<LearningModelDevice>>> { unsafe {
235235
let mut out = null_mut();
236236
let hr = ((*self.lpVtbl).CreateFromDirect3D11Device)(self as *const _ as *mut _, device as *const _ as *mut _, &mut out);
237237
if hr == S_OK { Ok(ComPtr::wrap_optional(out)) } else { err(hr) }

src/rt/gen/windows/graphics.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,12 +1518,12 @@ impl IHolographicCameraRenderingParameters {
15181518
let hr = ((*self.lpVtbl).SetFocusPointWithNormalLinearVelocity)(self as *const _ as *mut _, coordinateSystem as *const _ as *mut _, position, normal, linearVelocity);
15191519
if hr == S_OK { Ok(()) } else { err(hr) }
15201520
}}
1521-
#[inline] pub fn get_direct3d_11_device(&self) -> Result<Option<ComPtr<super::directx::direct3d11::IDirect3DDevice>>> { unsafe {
1521+
#[inline] pub fn get_direct3d11_device(&self) -> Result<Option<ComPtr<super::directx::direct3d11::IDirect3DDevice>>> { unsafe {
15221522
let mut out = null_mut();
15231523
let hr = ((*self.lpVtbl).get_Direct3D11Device)(self as *const _ as *mut _, &mut out);
15241524
if hr == S_OK { Ok(ComPtr::wrap_optional(out)) } else { err(hr) }
15251525
}}
1526-
#[inline] pub fn get_direct3d_11_back_buffer(&self) -> Result<Option<ComPtr<super::directx::direct3d11::IDirect3DSurface>>> { unsafe {
1526+
#[inline] pub fn get_direct3d11_back_buffer(&self) -> Result<Option<ComPtr<super::directx::direct3d11::IDirect3DSurface>>> { unsafe {
15271527
let mut out = null_mut();
15281528
let hr = ((*self.lpVtbl).get_Direct3D11BackBuffer)(self as *const _ as *mut _, &mut out);
15291529
if hr == S_OK { Ok(ComPtr::wrap_optional(out)) } else { err(hr) }
@@ -1546,7 +1546,7 @@ impl IHolographicCameraRenderingParameters2 {
15461546
let hr = ((*self.lpVtbl).put_ReprojectionMode)(self as *const _ as *mut _, value);
15471547
if hr == S_OK { Ok(()) } else { err(hr) }
15481548
}}
1549-
#[inline] pub fn commit_direct3d_11_depth_buffer(&self, value: &super::directx::direct3d11::IDirect3DSurface) -> Result<()> { unsafe {
1549+
#[inline] pub fn commit_direct3d11_depth_buffer(&self, value: &super::directx::direct3d11::IDirect3DSurface) -> Result<()> { unsafe {
15501550
let hr = ((*self.lpVtbl).CommitDirect3D11DepthBuffer)(self as *const _ as *mut _, value as *const _ as *mut _);
15511551
if hr == S_OK { Ok(()) } else { err(hr) }
15521552
}}
@@ -1916,7 +1916,7 @@ impl IHolographicSpace {
19161916
let hr = ((*self.lpVtbl).get_PrimaryAdapterId)(self as *const _ as *mut _, &mut out);
19171917
if hr == S_OK { Ok(out) } else { err(hr) }
19181918
}}
1919-
#[inline] pub fn set_direct3d_11_device(&self, value: &super::directx::direct3d11::IDirect3DDevice) -> Result<()> { unsafe {
1919+
#[inline] pub fn set_direct3d11_device(&self, value: &super::directx::direct3d11::IDirect3DDevice) -> Result<()> { unsafe {
19201920
let hr = ((*self.lpVtbl).SetDirect3D11Device)(self as *const _ as *mut _, value as *const _ as *mut _);
19211921
if hr == S_OK { Ok(()) } else { err(hr) }
19221922
}}

src/rt/gen/windows/media.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,17 +1422,17 @@ impl VideoFrame {
14221422
#[cfg(feature="windows-graphics")] #[inline] pub fn create_with_alpha(format: super::graphics::imaging::BitmapPixelFormat, width: i32, height: i32, alpha: super::graphics::imaging::BitmapAlphaMode) -> Result<ComPtr<VideoFrame>> {
14231423
<Self as RtActivatable<IVideoFrameFactory>>::get_activation_factory().create_with_alpha(format, width, height, alpha)
14241424
}
1425-
#[cfg(feature="windows-graphics")] #[inline] pub fn create_as_direct3d_11_surface_backed(format: super::graphics::directx::DirectXPixelFormat, width: i32, height: i32) -> Result<Option<ComPtr<VideoFrame>>> {
1426-
<Self as RtActivatable<IVideoFrameStatics>>::get_activation_factory().create_as_direct3d_11_surface_backed(format, width, height)
1425+
#[cfg(feature="windows-graphics")] #[inline] pub fn create_as_direct3d11_surface_backed(format: super::graphics::directx::DirectXPixelFormat, width: i32, height: i32) -> Result<Option<ComPtr<VideoFrame>>> {
1426+
<Self as RtActivatable<IVideoFrameStatics>>::get_activation_factory().create_as_direct3d11_surface_backed(format, width, height)
14271427
}
1428-
#[cfg(feature="windows-graphics")] #[inline] pub fn create_as_direct3d_11_surface_backed_with_device(format: super::graphics::directx::DirectXPixelFormat, width: i32, height: i32, device: &super::graphics::directx::direct3d11::IDirect3DDevice) -> Result<Option<ComPtr<VideoFrame>>> {
1429-
<Self as RtActivatable<IVideoFrameStatics>>::get_activation_factory().create_as_direct3d_11_surface_backed_with_device(format, width, height, device)
1428+
#[cfg(feature="windows-graphics")] #[inline] pub fn create_as_direct3d11_surface_backed_with_device(format: super::graphics::directx::DirectXPixelFormat, width: i32, height: i32, device: &super::graphics::directx::direct3d11::IDirect3DDevice) -> Result<Option<ComPtr<VideoFrame>>> {
1429+
<Self as RtActivatable<IVideoFrameStatics>>::get_activation_factory().create_as_direct3d11_surface_backed_with_device(format, width, height, device)
14301430
}
14311431
#[cfg(feature="windows-graphics")] #[inline] pub fn create_with_software_bitmap(bitmap: &super::graphics::imaging::SoftwareBitmap) -> Result<Option<ComPtr<VideoFrame>>> {
14321432
<Self as RtActivatable<IVideoFrameStatics>>::get_activation_factory().create_with_software_bitmap(bitmap)
14331433
}
1434-
#[cfg(feature="windows-graphics")] #[inline] pub fn create_with_direct3d_11_surface(surface: &super::graphics::directx::direct3d11::IDirect3DSurface) -> Result<Option<ComPtr<VideoFrame>>> {
1435-
<Self as RtActivatable<IVideoFrameStatics>>::get_activation_factory().create_with_direct3d_11_surface(surface)
1434+
#[cfg(feature="windows-graphics")] #[inline] pub fn create_with_direct3d11_surface(surface: &super::graphics::directx::direct3d11::IDirect3DSurface) -> Result<Option<ComPtr<VideoFrame>>> {
1435+
<Self as RtActivatable<IVideoFrameStatics>>::get_activation_factory().create_with_direct3d11_surface(surface)
14361436
}
14371437
}
14381438
DEFINE_CLSID!(VideoFrame(&[87,105,110,100,111,119,115,46,77,101,100,105,97,46,86,105,100,101,111,70,114,97,109,101,0]) [CLSID_VideoFrame]);
@@ -1472,12 +1472,12 @@ RT_INTERFACE!{static interface IVideoFrameStatics(IVideoFrameStaticsVtbl): IInsp
14721472
#[cfg(feature="windows-graphics")] fn CreateWithDirect3D11Surface(&self, surface: *mut super::graphics::directx::direct3d11::IDirect3DSurface, out: *mut *mut VideoFrame) -> HRESULT
14731473
}}
14741474
impl IVideoFrameStatics {
1475-
#[cfg(feature="windows-graphics")] #[inline] pub fn create_as_direct3d_11_surface_backed(&self, format: super::graphics::directx::DirectXPixelFormat, width: i32, height: i32) -> Result<Option<ComPtr<VideoFrame>>> { unsafe {
1475+
#[cfg(feature="windows-graphics")] #[inline] pub fn create_as_direct3d11_surface_backed(&self, format: super::graphics::directx::DirectXPixelFormat, width: i32, height: i32) -> Result<Option<ComPtr<VideoFrame>>> { unsafe {
14761476
let mut out = null_mut();
14771477
let hr = ((*self.lpVtbl).CreateAsDirect3D11SurfaceBacked)(self as *const _ as *mut _, format, width, height, &mut out);
14781478
if hr == S_OK { Ok(ComPtr::wrap_optional(out)) } else { err(hr) }
14791479
}}
1480-
#[cfg(feature="windows-graphics")] #[inline] pub fn create_as_direct3d_11_surface_backed_with_device(&self, format: super::graphics::directx::DirectXPixelFormat, width: i32, height: i32, device: &super::graphics::directx::direct3d11::IDirect3DDevice) -> Result<Option<ComPtr<VideoFrame>>> { unsafe {
1480+
#[cfg(feature="windows-graphics")] #[inline] pub fn create_as_direct3d11_surface_backed_with_device(&self, format: super::graphics::directx::DirectXPixelFormat, width: i32, height: i32, device: &super::graphics::directx::direct3d11::IDirect3DDevice) -> Result<Option<ComPtr<VideoFrame>>> { unsafe {
14811481
let mut out = null_mut();
14821482
let hr = ((*self.lpVtbl).CreateAsDirect3D11SurfaceBackedWithDevice)(self as *const _ as *mut _, format, width, height, device as *const _ as *mut _, &mut out);
14831483
if hr == S_OK { Ok(ComPtr::wrap_optional(out)) } else { err(hr) }
@@ -1487,7 +1487,7 @@ impl IVideoFrameStatics {
14871487
let hr = ((*self.lpVtbl).CreateWithSoftwareBitmap)(self as *const _ as *mut _, bitmap as *const _ as *mut _, &mut out);
14881488
if hr == S_OK { Ok(ComPtr::wrap_optional(out)) } else { err(hr) }
14891489
}}
1490-
#[cfg(feature="windows-graphics")] #[inline] pub fn create_with_direct3d_11_surface(&self, surface: &super::graphics::directx::direct3d11::IDirect3DSurface) -> Result<Option<ComPtr<VideoFrame>>> { unsafe {
1490+
#[cfg(feature="windows-graphics")] #[inline] pub fn create_with_direct3d11_surface(&self, surface: &super::graphics::directx::direct3d11::IDirect3DSurface) -> Result<Option<ComPtr<VideoFrame>>> { unsafe {
14911491
let mut out = null_mut();
14921492
let hr = ((*self.lpVtbl).CreateWithDirect3D11Surface)(self as *const _ as *mut _, surface as *const _ as *mut _, &mut out);
14931493
if hr == S_OK { Ok(ComPtr::wrap_optional(out)) } else { err(hr) }
@@ -7853,7 +7853,7 @@ RT_INTERFACE!{interface IMediaCaptureSettings3(IMediaCaptureSettings3Vtbl): IIns
78537853
#[cfg(feature="windows-graphics")] fn get_Direct3D11Device(&self, out: *mut *mut super::super::graphics::directx::direct3d11::IDirect3DDevice) -> HRESULT
78547854
}}
78557855
impl IMediaCaptureSettings3 {
7856-
#[cfg(feature="windows-graphics")] #[inline] pub fn get_direct3d_11_device(&self) -> Result<Option<ComPtr<super::super::graphics::directx::direct3d11::IDirect3DDevice>>> { unsafe {
7856+
#[cfg(feature="windows-graphics")] #[inline] pub fn get_direct3d11_device(&self) -> Result<Option<ComPtr<super::super::graphics::directx::direct3d11::IDirect3DDevice>>> { unsafe {
78577857
let mut out = null_mut();
78587858
let hr = ((*self.lpVtbl).get_Direct3D11Device)(self as *const _ as *mut _, &mut out);
78597859
if hr == S_OK { Ok(ComPtr::wrap_optional(out)) } else { err(hr) }
@@ -11704,8 +11704,8 @@ impl MediaStreamSample {
1170411704
#[cfg(feature="windows-storage")] #[inline] pub fn create_from_stream_async(stream: &super::super::storage::streams::IInputStream, count: u32, timestamp: foundation::TimeSpan) -> Result<ComPtr<foundation::IAsyncOperation<MediaStreamSample>>> {
1170511705
<Self as RtActivatable<IMediaStreamSampleStatics>>::get_activation_factory().create_from_stream_async(stream, count, timestamp)
1170611706
}
11707-
#[cfg(feature="windows-graphics")] #[inline] pub fn create_from_direct3d_11_surface(surface: &super::super::graphics::directx::direct3d11::IDirect3DSurface, timestamp: foundation::TimeSpan) -> Result<Option<ComPtr<MediaStreamSample>>> {
11708-
<Self as RtActivatable<IMediaStreamSampleStatics2>>::get_activation_factory().create_from_direct3d_11_surface(surface, timestamp)
11707+
#[cfg(feature="windows-graphics")] #[inline] pub fn create_from_direct3d11_surface(surface: &super::super::graphics::directx::direct3d11::IDirect3DSurface, timestamp: foundation::TimeSpan) -> Result<Option<ComPtr<MediaStreamSample>>> {
11708+
<Self as RtActivatable<IMediaStreamSampleStatics2>>::get_activation_factory().create_from_direct3d11_surface(surface, timestamp)
1170911709
}
1171011710
}
1171111711
DEFINE_CLSID!(MediaStreamSample(&[87,105,110,100,111,119,115,46,77,101,100,105,97,46,67,111,114,101,46,77,101,100,105,97,83,116,114,101,97,109,83,97,109,112,108,101,0]) [CLSID_MediaStreamSample]);
@@ -11714,7 +11714,7 @@ RT_INTERFACE!{interface IMediaStreamSample2(IMediaStreamSample2Vtbl): IInspectab
1171411714
#[cfg(feature="windows-graphics")] fn get_Direct3D11Surface(&self, out: *mut *mut super::super::graphics::directx::direct3d11::IDirect3DSurface) -> HRESULT
1171511715
}}
1171611716
impl IMediaStreamSample2 {
11717-
#[cfg(feature="windows-graphics")] #[inline] pub fn get_direct3d_11_surface(&self) -> Result<Option<ComPtr<super::super::graphics::directx::direct3d11::IDirect3DSurface>>> { unsafe {
11717+
#[cfg(feature="windows-graphics")] #[inline] pub fn get_direct3d11_surface(&self) -> Result<Option<ComPtr<super::super::graphics::directx::direct3d11::IDirect3DSurface>>> { unsafe {
1171811718
let mut out = null_mut();
1171911719
let hr = ((*self.lpVtbl).get_Direct3D11Surface)(self as *const _ as *mut _, &mut out);
1172011720
if hr == S_OK { Ok(ComPtr::wrap_optional(out)) } else { err(hr) }
@@ -11782,7 +11782,7 @@ RT_INTERFACE!{static interface IMediaStreamSampleStatics2(IMediaStreamSampleStat
1178211782
#[cfg(feature="windows-graphics")] fn CreateFromDirect3D11Surface(&self, surface: *mut super::super::graphics::directx::direct3d11::IDirect3DSurface, timestamp: foundation::TimeSpan, out: *mut *mut MediaStreamSample) -> HRESULT
1178311783
}}
1178411784
impl IMediaStreamSampleStatics2 {
11785-
#[cfg(feature="windows-graphics")] #[inline] pub fn create_from_direct3d_11_surface(&self, surface: &super::super::graphics::directx::direct3d11::IDirect3DSurface, timestamp: foundation::TimeSpan) -> Result<Option<ComPtr<MediaStreamSample>>> { unsafe {
11785+
#[cfg(feature="windows-graphics")] #[inline] pub fn create_from_direct3d11_surface(&self, surface: &super::super::graphics::directx::direct3d11::IDirect3DSurface, timestamp: foundation::TimeSpan) -> Result<Option<ComPtr<MediaStreamSample>>> { unsafe {
1178611786
let mut out = null_mut();
1178711787
let hr = ((*self.lpVtbl).CreateFromDirect3D11Surface)(self as *const _ as *mut _, surface as *const _ as *mut _, timestamp, &mut out);
1178811788
if hr == S_OK { Ok(ComPtr::wrap_optional(out)) } else { err(hr) }

0 commit comments

Comments
 (0)