You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
StartupRemoteRendering(managerInit); // static function in namespace Microsoft::Azure::RemoteRendering
43
47
```
44
48
45
49
The call above is necessary to initialize Azure Remote Rendering into the holographic APIs. This function must be called before any holographic API is called and before any other Remote Rendering APIs are accessed. Similarly, the corresponding de-init function `RemoteManagerStatic.ShutdownRemoteRendering();` should be called after no holographic APIs are being called anymore.
@@ -49,19 +53,27 @@ The call above is necessary to initialize Azure Remote Rendering into the hologr
49
53
Once a client is set up, the basic graphics binding can be accessed with the `AzureSession.GraphicsBinding` getter. As an example, the last frame statistics can be retrieved like this:
50
54
51
55
```cs
52
-
AzureSessioncurrentSesson=...;
53
-
if (currentSesson.GraphicsBinding)
56
+
AzureSession currentSession = ...;
57
+
if (currentSession.GraphicsBinding)
54
58
{
55
59
FrameStatistics frameStatistics;
56
-
if (session.GraphicsBinding.GetLastFrameStatistics(outframeStatistics) ==Result.Success)
60
+
if (currentSession.GraphicsBinding.GetLastFrameStatistics(out frameStatistics) == Result.Success)
57
61
{
58
62
...
59
63
}
60
64
}
61
65
```
62
66
63
67
```cpp
64
-
TODO
68
+
ApiHandle<AzureSession> currentSession = ...;
69
+
if (ApiHandle<GraphicsBinding> binding = currentSession->GetGraphicsBinding())
70
+
{
71
+
FrameStatistics frameStatistics;
72
+
if (*binding->GetLastFrameStatistics(&frameStatistics) == Result::Success)
73
+
{
74
+
...
75
+
}
76
+
}
65
77
```
66
78
67
79
## Graphic APIs
@@ -78,17 +90,23 @@ There are two things that need to be done to use the WMR binding:
78
90
#### Inform Remote Rendering of the used coordinate system
79
91
80
92
```cs
81
-
AzureSessioncurrentSesson=...;
93
+
AzureSessioncurrentSession=...;
82
94
IntPtrptr=...; // native pointer to ISpatialCoordinateSystem
if (*wmrBinding->UpdateUserCoordinateSystem(ptr) == Result::Success)
107
+
{
108
+
//...
109
+
}
92
110
```
93
111
94
112
@@ -99,13 +117,15 @@ Where the above `ptr` must be a pointer to a native `ABI::Windows::Perception::S
99
117
At the start of each frame the remote frame needs to be rendered into the back buffer. This is done by calling `BlitRemoteFrame`, which will fill both color and depth information into the currently bound render target. Thus it is important that this is done after binding the back buffer as a render target.
100
118
101
119
```cs
102
-
AzureSessioncurrentSesson=...;
120
+
AzureSession currentSession = ...;
103
121
GraphicsBindingWmrD3d11 wmrBinding = (currentSession.GraphicsBinding as GraphicsBindingWmrD3d11);
@@ -119,7 +139,7 @@ Remote and local content needs to be rendered to an offscreen color / depth rend
119
139
the proxy camera data provided by the `GraphicsBindingSimD3d11.Update` function. The proxy must match the resolution of the back buffer. Once a session is ready, `GraphicsBindingSimD3d11.InitSimulation` needs to be called before connecting to it:
120
140
121
141
```cs
122
-
AzureSessioncurrentSesson=...;
142
+
AzureSessioncurrentSession=...;
123
143
IntPtrd3dDevice=...; // native pointer to ID3D11Device
124
144
IntPtrcolor=...; // native pointer to ID3D11Texture2D
125
145
IntPtrdepth=...; // native pointer to ID3D11Texture2D
The init function needs to be provided with pointers to the native d3d-device as well as to the color and depth texture of the proxy render target. Once initialized, `AzureSession.ConnectToRuntime` and `DisconnectFromRuntime` can be called multiple times but when switching to a different session, `GraphicsBindingSimD3d11.DeinitSimulation` needs to be called first on the old session before `GraphicsBindingSimD3d11.InitSimulation` can be called on another session.
@@ -146,7 +174,7 @@ If the returned proxy update `SimulationUpdate.frameId` is null, there is no rem
146
174
1. Next, the back buffer needs to be bound as a render target and `GraphicsBindingSimD3d11.ReprojectProxy` called at which point the back buffer can be presented.
147
175
148
176
```cs
149
-
AzureSessioncurrentSesson=...;
177
+
AzureSession currentSession = ...;
150
178
GraphicsBindingSimD3d11 simBinding = (currentSession.GraphicsBinding as GraphicsBindingSimD3d11);
Multiple `AzureFrontend` and `AzureSession` instances can be maintained, manipulated, and queried from code. But only a single device may connect to an `AzureSession` at a time.
140
135
141
136
The lifetime of a virtual machine isn't tied to the `AzureFrontend` instance or the `AzureSession` instance. `AzureSession.StopAsync` must be called to stop a session.
0 commit comments