Merge pull request #4 from microsoft/FlorianBagarMicrosoft-patch-2

version 2.0.14
This commit is contained in:
FlorianBagarMicrosoft 2019-10-28 14:26:29 +01:00 коммит произвёл GitHub
Родитель e1b2759597 b9b03196ff
Коммит d6ff35e13a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
20 изменённых файлов: 106 добавлений и 102 удалений

Просмотреть файл

@ -44,7 +44,7 @@
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="packages\Microsoft.Holographic.Remoting.2.0.7\build\native\Microsoft.Holographic.Remoting.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.2.0.7\build\native\Microsoft.Holographic.Remoting.targets')" />
<Import Project="packages\Microsoft.Holographic.Remoting.2.0.14\build\native\Microsoft.Holographic.Remoting.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.2.0.14\build\native\Microsoft.Holographic.Remoting.targets')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap mp rescap">
<Identity Name="b0cf2e39-8f6e-4238-b33a-868c9b1122ce" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="2.0.7.0" />
<Identity Name="b0cf2e39-8f6e-4238-b33a-868c9b1122ce" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="2.0.14.0" />
<mp:PhoneIdentity PhoneProductId="b0cf2e39-8f6e-4238-b33a-868c9b1122ce" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>RemotingHostSample</DisplayName>

Просмотреть файл

@ -24,6 +24,9 @@
#include <winrt/Microsoft.Holographic.AppRemoting.h>
#include <winrt/Windows.Perception.People.h>
#include <iosfwd>
#include <sstream>
using namespace concurrency;
@ -115,6 +118,7 @@ HolographicFrame SampleHostMain::Update()
// When the Tapped spatial input event is received, the sample hologram will be repositioned two meters in front of the user.
m_spinningCubeRenderer->PositionHologram(pointerPose);
}
else
{
@ -192,7 +196,7 @@ HolographicFrame SampleHostMain::Update()
m_customDataChannel.SendData(
winrt::array_view<const uint8_t>(reinterpret_cast<const uint8_t*>(&data), reinterpret_cast<const uint8_t*>(&data + 1)),
true);
OutputDebugString(TEXT("Request Sent.\n"));
OutputDebugString(TEXT("Ping Sent.\n"));
}
}
#endif
@ -339,6 +343,7 @@ void SampleHostMain::OnKeyPress(char key)
SavePosition();
break;
case 'c':
m_spinningCubeRenderer->TogglePauseState();
break;
@ -658,6 +663,7 @@ void SampleHostMain::SavePosition()
});
}
void SampleHostMain::RequestEyesPoseAccess()
{
try

Просмотреть файл

@ -35,7 +35,6 @@
#define TITLE_ENABLE_PREVIEW_TEXT L"Preview Disabled (press P to enable)"
#define TITLE_DISABLE_PREVIEW_TEXT L"Preview Enabled (press P to disable)"
// #define ENABLE_CUSTOM_DATA_CHANNEL_SAMPLE
class SampleHostMain : public std::enable_shared_from_this<SampleHostMain>, public DXHelper::IDeviceNotify
{
@ -96,6 +95,7 @@ private:
// Saves the position of the spinning cube.
void SavePosition();
// Request access for eyes pose data.
void RequestEyesPoseAccess();
@ -207,4 +207,5 @@ private:
winrt::Microsoft::Holographic::AppRemoting::IDataChannel::OnClosed_revoker m_customChannelClosedEventRevoker;
std::chrono::high_resolution_clock::time_point m_customDataChannelSendTime = std::chrono::high_resolution_clock::now();
#endif
};

Просмотреть файл

@ -30,8 +30,7 @@ LRESULT CALLBACK wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
switch (msg)
{
case WM_CREATE:
{
case WM_CREATE: {
CREATESTRUCT* cs = reinterpret_cast<CREATESTRUCT*>(lParam);
s_sampleHostWindow = reinterpret_cast<SampleHostWindowWin32*>(cs->lpCreateParams);
@ -42,8 +41,7 @@ LRESULT CALLBACK wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
result = 0;
}
break;
case WM_WINDOWPOSCHANGED:
{
case WM_WINDOWPOSCHANGED: {
auto windowPos = reinterpret_cast<WINDOWPOS*>(lParam);
if ((windowPos->flags & SWP_NOSIZE) == 0)
{
@ -55,21 +53,18 @@ LRESULT CALLBACK wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
result = 0;
}
break;
case WM_DESTROY:
{
case WM_DESTROY: {
s_sampleHostWindow = nullptr;
result = 0;
PostQuitMessage(0);
}
break;
case WM_CLOSE:
{
case WM_CLOSE: {
DestroyWindow(hWnd);
result = 0;
}
break;
case WM_CHAR:
{
case WM_CHAR: {
const int key = tolower(static_cast<int>(wParam));
s_sampleHostWindow->OnKeyPress(static_cast<char>(key));
}

Просмотреть файл

@ -15,6 +15,8 @@
#include "SampleHostMain.h"
// #define ENABLE_CUSTOM_DATA_CHANNEL_SAMPLE
class SampleHostWindowWin32 : public std::enable_shared_from_this<SampleHostWindowWin32>, public SampleHostMain::IWindow
{
public:

Просмотреть файл

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Holographic.Remoting" version="2.0.7" targetFramework="native" />
<package id="Microsoft.Holographic.Remoting" version="2.0.14" targetFramework="native" />
</packages>

Просмотреть файл

@ -49,7 +49,7 @@
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="packages\Microsoft.Holographic.Remoting.2.0.7\build\native\Microsoft.Holographic.Remoting.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.2.0.7\build\native\Microsoft.Holographic.Remoting.targets')" />
<Import Project="packages\Microsoft.Holographic.Remoting.2.0.14\build\native\Microsoft.Holographic.Remoting.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.2.0.14\build\native\Microsoft.Holographic.Remoting.targets')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap mp rescap">
<Identity Name="b0cf2e39-8f6e-4238-b33a-868c9b1122ce" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="2.0.7.0" />
<Identity Name="b0cf2e39-8f6e-4238-b33a-868c9b1122ce" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="2.0.14.0" />
<mp:PhoneIdentity PhoneProductId="b0cf2e39-8f6e-4238-b33a-868c9b1122ce" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>RemotingHostSample</DisplayName>

Просмотреть файл

@ -24,6 +24,9 @@
#include <winrt/Microsoft.Holographic.AppRemoting.h>
#include <winrt/Windows.Perception.People.h>
#include <iosfwd>
#include <sstream>
using namespace concurrency;
@ -115,6 +118,7 @@ HolographicFrame SampleHostMain::Update()
// When the Tapped spatial input event is received, the sample hologram will be repositioned two meters in front of the user.
m_spinningCubeRenderer->PositionHologram(pointerPose);
}
else
{
@ -339,6 +343,7 @@ void SampleHostMain::OnKeyPress(char key)
SavePosition();
break;
case 'c':
m_spinningCubeRenderer->TogglePauseState();
break;
@ -658,6 +663,7 @@ void SampleHostMain::SavePosition()
});
}
void SampleHostMain::RequestEyesPoseAccess()
{
try

Просмотреть файл

@ -95,6 +95,7 @@ private:
// Saves the position of the spinning cube.
void SavePosition();
// Request access for eyes pose data.
void RequestEyesPoseAccess();
@ -206,4 +207,5 @@ private:
winrt::Microsoft::Holographic::AppRemoting::IDataChannel::OnClosed_revoker m_customChannelClosedEventRevoker;
std::chrono::high_resolution_clock::time_point m_customDataChannelSendTime = std::chrono::high_resolution_clock::now();
#endif
};

Просмотреть файл

@ -30,8 +30,7 @@ LRESULT CALLBACK wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
switch (msg)
{
case WM_CREATE:
{
case WM_CREATE: {
CREATESTRUCT* cs = reinterpret_cast<CREATESTRUCT*>(lParam);
s_sampleHostWindow = reinterpret_cast<SampleHostWindowWin32*>(cs->lpCreateParams);
@ -42,8 +41,7 @@ LRESULT CALLBACK wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
result = 0;
}
break;
case WM_WINDOWPOSCHANGED:
{
case WM_WINDOWPOSCHANGED: {
auto windowPos = reinterpret_cast<WINDOWPOS*>(lParam);
if ((windowPos->flags & SWP_NOSIZE) == 0)
{
@ -55,21 +53,18 @@ LRESULT CALLBACK wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
result = 0;
}
break;
case WM_DESTROY:
{
case WM_DESTROY: {
s_sampleHostWindow = nullptr;
result = 0;
PostQuitMessage(0);
}
break;
case WM_CLOSE:
{
case WM_CLOSE: {
DestroyWindow(hWnd);
result = 0;
}
break;
case WM_CHAR:
{
case WM_CHAR: {
const int key = tolower(static_cast<int>(wParam));
s_sampleHostWindow->OnKeyPress(static_cast<char>(key));
}

Просмотреть файл

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Holographic.Remoting" version="2.0.7" targetFramework="native" />
<package id="Microsoft.Holographic.Remoting" version="2.0.14" targetFramework="native" />
</packages>

Просмотреть файл

@ -21,8 +21,8 @@
#include "pch.h"
#include <algorithm>
#include <assert.h>
#include <algorithm>
#include <memory>
#include "DDSTextureLoader.h"

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" IgnorableNamespaces="uap mp uap2">
<Identity Name="SampleHolographicRemotingPlayer" Publisher="CN=SampleHolographicRemotingPlayer" Version="2.0.7.0" />
<Identity Name="SampleHolographicRemotingPlayer" Publisher="CN=SampleHolographicRemotingPlayer" Version="2.0.14.0" />
<mp:PhoneIdentity PhoneProductId="b65c9a46-d0b3-4954-829a-6a60bed54d0a" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>Sample Holographic AppRemoting Player</DisplayName>

Просмотреть файл

@ -49,7 +49,7 @@
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="packages\Microsoft.Holographic.Remoting.2.0.7\build\native\Microsoft.Holographic.Remoting.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.2.0.7\build\native\Microsoft.Holographic.Remoting.targets')" />
<Import Project="packages\Microsoft.Holographic.Remoting.2.0.14\build\native\Microsoft.Holographic.Remoting.targets" Condition="Exists('packages\Microsoft.Holographic.Remoting.2.0.14\build\native\Microsoft.Holographic.Remoting.targets')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>

Просмотреть файл

@ -271,8 +271,8 @@ void SamplePlayerMain::Initialize(const CoreApplicationView& applicationView)
applicationView.Activated({this, &SamplePlayerMain::OnViewActivated});
// Register event handlers for app lifecycle.
m_suspendingEventToken = CoreApplication::Suspending({this, &SamplePlayerMain::OnSuspending});
m_resumingEventToken = CoreApplication::Resuming({this, &SamplePlayerMain::OnResuming});
m_suspendingEventRevoker = CoreApplication::Suspending(winrt::auto_revoke, {this, &SamplePlayerMain::OnSuspending});
m_resumingEventRevoker = CoreApplication::Resuming(winrt::auto_revoke, {this, &SamplePlayerMain::OnResuming});
m_deviceResources = std::make_shared<DXHelper::DeviceResources>();
m_deviceResources->RegisterDeviceNotify(this);
@ -280,7 +280,8 @@ void SamplePlayerMain::Initialize(const CoreApplicationView& applicationView)
m_spatialLocator = SpatialLocator::GetDefault();
if (m_spatialLocator != nullptr)
{
m_locatabilityChangedToken = m_spatialLocator.LocatabilityChanged({this, &SamplePlayerMain::OnLocatabilityChanged});
m_locatabilityChangedRevoker =
m_spatialLocator.LocatabilityChanged(winrt::auto_revoke, {this, &SamplePlayerMain::OnLocatabilityChanged});
m_attachedFrameOfReference = m_spatialLocator.CreateAttachedFrameOfReferenceAtCurrentHeading();
}
@ -291,12 +292,15 @@ void SamplePlayerMain::Initialize(const CoreApplicationView& applicationView)
// Register to the PlayerContext connection events
m_playerContext.OnConnected({this, &SamplePlayerMain::OnConnected});
m_playerContext.OnDisconnected({this, &SamplePlayerMain::OnDisconnected});
// Set the BlitRemoteFrame timeout to 0.5s
m_playerContext.BlitRemoteFrameTimeout(500ms);
}
void SamplePlayerMain::SetWindow(const CoreWindow& window)
{
m_windowClosedEventToken = window.Closed({this, &SamplePlayerMain::OnWindowClosed});
m_visibilityChangedEventToken = window.VisibilityChanged({this, &SamplePlayerMain::OnVisibilityChanged});
m_windowClosedEventRevoker = window.Closed(winrt::auto_revoke, {this, &SamplePlayerMain::OnWindowClosed});
m_visibilityChangedEventRevoker = window.VisibilityChanged(winrt::auto_revoke, {this, &SamplePlayerMain::OnVisibilityChanged});
// Forward the window to the device resources, so that it can create a holographic space for the window.
m_deviceResources->SetWindow(window);
@ -376,17 +380,11 @@ void SamplePlayerMain::Uninitialize()
m_deviceResources.reset();
}
if (m_spatialLocator != nullptr)
{
m_spatialLocator.LocatabilityChanged(m_locatabilityChangedToken);
}
CoreApplication::Suspending(m_suspendingEventToken);
CoreApplication::Resuming(m_resumingEventToken);
const auto& window = CoreWindow::GetForCurrentThread();
window.Closed(m_windowClosedEventToken);
window.VisibilityChanged(m_visibilityChangedEventToken);
m_locatabilityChangedRevoker.revoke();
m_suspendingEventRevoker.revoke();
m_resumingEventRevoker.revoke();
m_windowClosedEventRevoker.revoke();
m_visibilityChangedEventRevoker.revoke();
}
#pragma endregion IFrameworkView methods
@ -623,7 +621,6 @@ void SamplePlayerMain::OnCustomDataChannelDataReceived()
{
uint8_t data[] = {1};
m_customDataChannel.SendData(data, true);
OutputDebugString(TEXT("Response Sent.\n"));
}
}

Просмотреть файл

@ -151,10 +151,10 @@ private:
bool m_windowClosed = false;
bool m_windowVisible = true;
// Event registration tokens
winrt::event_token m_locatabilityChangedToken;
winrt::event_token m_suspendingEventToken;
winrt::event_token m_resumingEventToken;
winrt::event_token m_windowClosedEventToken;
winrt::event_token m_visibilityChangedEventToken;
// Event registration revokers
winrt::Windows::Perception::Spatial::SpatialLocator::LocatabilityChanged_revoker m_locatabilityChangedRevoker;
winrt::Windows::ApplicationModel::Core::CoreApplication::Suspending_revoker m_suspendingEventRevoker;
winrt::Windows::ApplicationModel::Core::CoreApplication::Resuming_revoker m_resumingEventRevoker;
winrt::Windows::UI::Core::CoreWindow::Closed_revoker m_windowClosedEventRevoker;
winrt::Windows::UI::Core::CoreWindow::VisibilityChanged_revoker m_visibilityChangedEventRevoker;
};

Просмотреть файл

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Holographic.Remoting" version="2.0.7" targetFramework="native" />
<package id="Microsoft.Holographic.Remoting" version="2.0.14" targetFramework="native" />
</packages>