From: Hans Leidekker hans@codeweavers.com
--- include/Makefile.in | 1 + include/windows.graphics.holographic.idl | 152 ++++++++++++++++++++++- include/windows.perception.idl | 54 ++++++++ 3 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 include/windows.perception.idl
diff --git a/include/Makefile.in b/include/Makefile.in index 159a100b4ca..d2bc8d3436f 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -913,6 +913,7 @@ SOURCES = \ windows.networking.connectivity.idl \ windows.networking.idl \ windows.networking.sockets.idl \ + windows.perception.idl \ windows.perception.spatial.idl \ windows.perception.spatial.surfaces.idl \ windows.security.authentication.onlineid.idl \ diff --git a/include/windows.graphics.holographic.idl b/include/windows.graphics.holographic.idl index 204b1fd4886..05731f62b02 100644 --- a/include/windows.graphics.holographic.idl +++ b/include/windows.graphics.holographic.idl @@ -28,15 +28,26 @@ import "windows.foundation.idl"; import "windows.foundation.numerics.idl"; import "windows.graphics.directx.idl"; import "windows.graphics.directx.direct3d11.idl"; -/* import "windows.perception.idl"; */ +import "windows.perception.idl"; import "windows.perception.spatial.idl"; import "windows.ui.core.idl";
+namespace Windows.Perception { + runtimeclass PerceptionTimestamp; +} + namespace Windows.Graphics.Holographic { + typedef enum HolographicFramePresentResult HolographicFramePresentResult; + typedef enum HolographicFramePresentWaitBehavior HolographicFramePresentWaitBehavior; + typedef struct HolographicAdapterId HolographicAdapterId; + typedef struct HolographicStereoTransform HolographicStereoTransform;
interface IHolographicCamera; + interface IHolographicCameraPose; + interface IHolographicCameraRenderingParameters; interface IHolographicFrame; + interface IHolographicFramePrediction; interface IHolographicSpaceStatics; interface IHolographicSpaceStatics2; interface IHolographicSpaceStatics3; @@ -44,17 +55,41 @@ namespace Windows.Graphics.Holographic { interface IHolographicSpaceCameraRemovedEventArgs;
runtimeclass HolographicCamera; + runtimeclass HolographicCameraPose; + runtimeclass HolographicCameraRenderingParameters; runtimeclass HolographicFrame; + runtimeclass HolographicFramePrediction; runtimeclass HolographicSpace; runtimeclass HolographicSpaceCameraAddedEventArgs; runtimeclass HolographicSpaceCameraRemovedEventArgs;
declare { + interface Windows.Foundation.Collections.IVectorView<Windows.Graphics.Holographic.HolographicCamera *>; + interface Windows.Foundation.Collections.IVectorView<Windows.Graphics.Holographic.HolographicCameraPose *>; + interface Windows.Foundation.IReference<Windows.Graphics.Holographic.HolographicStereoTransform>; interface Windows.Foundation.TypedEventHandler<Windows.Graphics.Holographic.HolographicSpace *, IInspectable *>; interface Windows.Foundation.TypedEventHandler<Windows.Graphics.Holographic.HolographicSpace *, Windows.Graphics.Holographic.HolographicSpaceCameraAddedEventArgs *>; interface Windows.Foundation.TypedEventHandler<Windows.Graphics.Holographic.HolographicSpace *, Windows.Graphics.Holographic.HolographicSpaceCameraRemovedEventArgs *>; }
+ [ + contract(Windows.Foundation.UniversalApiContract, 2.0) + ] + enum HolographicFramePresentResult + { + Success = 0, + DeviceRemoved = 1, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 2.0) + ] + enum HolographicFramePresentWaitBehavior + { + WaitForFrameToFinish = 0, + DoNotWaitForFrameToFinish = 1, + }; + [ contract(Windows.Foundation.UniversalApiContract, 2.0) ] @@ -64,6 +99,91 @@ namespace Windows.Graphics.Holographic { INT32 HighPart; };
+ [ + contract(Windows.Foundation.UniversalApiContract, 2.0) + ] + struct HolographicStereoTransform + { + Windows.Foundation.Numerics.Matrix4x4 Left; + Windows.Foundation.Numerics.Matrix4x4 Right; + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 2.0), + exclusiveto(Windows.Graphics.Holographic.HolographicCamera), + uuid(e4e98445-9bed-4980-9ba0-e87680d1cb74) + ] + interface IHolographicCamera : IInspectable + { + [propget] HRESULT RenderTargetSize([out, retval] Windows.Foundation.Size *value); + [propget] HRESULT ViewportScaleFactor([out, retval] DOUBLE *value); + [propput] HRESULT ViewportScaleFactor([in] DOUBLE value); + [propget] HRESULT IsStereo([out, retval] boolean *value); + [propget] HRESULT Id([out, retval] UINT32 *value); + HRESULT SetNearPlaneDistance([in] DOUBLE value); + HRESULT SetFarPlaneDistance([in] DOUBLE value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 2.0), + exclusiveto(Windows.Graphics.Holographic.HolographicCameraPose), + uuid(0d7d7e30-12de-45bd-912b-c7f6561599d1) + ] + interface IHolographicCameraPose : IInspectable + { + [propget] HRESULT HolographicCamera([out, retval] Windows.Graphics.Holographic.HolographicCamera **value); + [propget] HRESULT Viewport([out, retval] Windows.Foundation.Rect *value); + HRESULT TryGetViewTransform([in] Windows.Perception.Spatial.SpatialCoordinateSystem *coordinate_system, [out, retval] Windows.Foundation.IReference<Windows.Graphics.Holographic.HolographicStereoTransform> **value); + [propget] HRESULT ProjectionTransform([out, retval] Windows.Graphics.Holographic.HolographicStereoTransform *value); + HRESULT TryGetCullingFrustum([in] Windows.Perception.Spatial.SpatialCoordinateSystem *coordinate_system, [out, retval] Windows.Foundation.IReference<Windows.Perception.Spatial.SpatialBoundingFrustum> **value); + HRESULT TryGetVisibleFrustum([in] Windows.Perception.Spatial.SpatialCoordinateSystem* coordinateSystem, [out, retval] Windows.Foundation.IReference<Windows.Perception.Spatial.SpatialBoundingFrustum> **value); + [propget] HRESULT NearPlaneDistance([out, retval] DOUBLE *value); + [propget] HRESULT FarPlaneDistance([out, retval] DOUBLE *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 2.0), + exclusiveto(Windows.Graphics.Holographic.HolographicCameraRenderingParameters), + uuid(8eac2ed1-5bf4-4e16-8236-ae0800c11d0d) + ] + interface IHolographicCameraRenderingParameters : IInspectable + { + [overload("SetFocusPoint")] HRESULT SetFocusPoint([in] Windows.Perception.Spatial.SpatialCoordinateSystem *coordinate_system, [in] Windows.Foundation.Numerics.Vector3 position); + [overload("SetFocusPoint")] HRESULT SetFocusPointWithNormal([in] Windows.Perception.Spatial.SpatialCoordinateSystem *coordinate_system, [in] Windows.Foundation.Numerics.Vector3 position, [in] Windows.Foundation.Numerics.Vector3 normal); + [overload("SetFocusPoint")] HRESULT SetFocusPointWithNormalLinearVelocity([in] Windows.Perception.Spatial.SpatialCoordinateSystem *coordinate_system, [in] Windows.Foundation.Numerics.Vector3 position, [in] Windows.Foundation.Numerics.Vector3 normal, [in] Windows.Foundation.Numerics.Vector3 linearVelocity); + [propget] HRESULT Direct3D11Device([out, retval] Windows.Graphics.DirectX.Direct3D11.IDirect3DDevice **value); + [propget] HRESULT Direct3D11BackBuffer([out, retval] Windows.Graphics.DirectX.Direct3D11.IDirect3DSurface **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 2.0), + exclusiveto(Windows.Graphics.Holographic.HolographicFrame), + uuid(c6988eb6-a8b9-3054-a6eb-d624b6536375) + ] + interface IHolographicFrame : IInspectable + { + [propget] HRESULT AddedCameras([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Graphics.Holographic.HolographicCamera *> **value); + [propget] HRESULT RemovedCameras([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Graphics.Holographic.HolographicCamera *> **value); + HRESULT GetRenderingParameters([in] Windows.Graphics.Holographic.HolographicCameraPose *camera_pose, [out, retval] Windows.Graphics.Holographic.HolographicCameraRenderingParameters **value); + [propget] HRESULT Duration([out, retval] Windows.Foundation.TimeSpan *value); + [propget] HRESULT CurrentPrediction([out, retval] Windows.Graphics.Holographic.HolographicFramePrediction **value); + HRESULT UpdateCurrentPrediction(); + [overload("PresentUsingCurrentPrediction")] HRESULT PresentUsingCurrentPrediction([out, retval] Windows.Graphics.Holographic.HolographicFramePresentResult *result); + [overload("PresentUsingCurrentPrediction")] HRESULT PresentUsingCurrentPredictionWithBehavior([in] Windows.Graphics.Holographic.HolographicFramePresentWaitBehavior wait_behavior, [out, retval] Windows.Graphics.Holographic.HolographicFramePresentResult *result); + HRESULT WaitForFrameToFinish(); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 2.0), + exclusiveto(Windows.Graphics.Holographic.HolographicFramePrediction), + uuid(520f4de1-5c0a-4e79-a81e-6abe02bb2739) + ] + interface IHolographicFramePrediction : IInspectable + { + [propget] HRESULT CameraPoses([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Graphics.Holographic.HolographicCameraPose *> **value); + [propget] HRESULT Timestamp([out, retval] Windows.Perception.PerceptionTimestamp **value); + } + [ contract(Windows.Foundation.UniversalApiContract, 2.0), exclusiveto(Windows.Graphics.Holographic.HolographicSpace), @@ -140,6 +260,26 @@ namespace Windows.Graphics.Holographic { [default] interface Windows.Graphics.Holographic.IHolographicCamera; }
+ [ + contract(Windows.Foundation.UniversalApiContract, 2.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass HolographicCameraPose + { + [default] interface Windows.Graphics.Holographic.IHolographicCameraPose; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 2.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass HolographicCameraRenderingParameters + { + [default] interface Windows.Graphics.Holographic.IHolographicCameraRenderingParameters; + } + [ contract(Windows.Foundation.UniversalApiContract, 2.0), marshaling_behavior(agile), @@ -150,6 +290,16 @@ namespace Windows.Graphics.Holographic { [default] interface Windows.Graphics.Holographic.IHolographicFrame; }
+ [ + contract(Windows.Foundation.UniversalApiContract, 2.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass HolographicFramePrediction + { + [default] interface Windows.Graphics.Holographic.IHolographicFramePrediction; + } + [ contract(Windows.Foundation.UniversalApiContract, 2.0), marshaling_behavior(agile), diff --git a/include/windows.perception.idl b/include/windows.perception.idl new file mode 100644 index 00000000000..e13195c39a1 --- /dev/null +++ b/include/windows.perception.idl @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "inspectable.idl"; +import "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; + +namespace Windows.Perception { + interface IPerceptionTimestamp; + + runtimeclass PerceptionTimestamp; + + [ + contract(Windows.Foundation.UniversalApiContract, 2.0), + exclusiveto(Windows.Perception.PerceptionTimestamp), + uuid(87c24804-a22e-4adb-ba26-d78ef639bcf4) + ] + interface IPerceptionTimestamp : IInspectable + { + [propget] HRESULT TargetTime([out, retval] Windows.Foundation.DateTime *value); + [propget] HRESULT PredictionAmount([out, retval] Windows.Foundation.TimeSpan *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 2.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass PerceptionTimestamp + { + [default] interface Windows.Perception.IPerceptionTimestamp; + } +}