UWP fixes

This commit is contained in:
Jack Andersen 2017-12-06 18:08:44 -10:00
parent f228f23661
commit 62c2b1ffac
7 changed files with 68 additions and 38 deletions

View File

@ -61,6 +61,7 @@ if(WINDOWS_STORE)
lib/audiodev/WASAPI.cpp)
list(APPEND PLAT_HDRS
include/boo/UWPViewProvider.hpp
include/boo/graphicsdev/D3D.hpp)
list(APPEND _BOO_SYS_DEFINES -DUNICODE -D_UNICODE)
@ -295,3 +296,7 @@ add_library(boo
${PLAT_HDRS})
add_subdirectory(test)
if(WINDOWS_STORE)
set_property(TARGET boo booTest PROPERTY VS_WINRT_COMPONENT TRUE)
endif()

View File

@ -81,41 +81,6 @@ ApplicationRun(IApplication::EPlatformType platform,
return ApplicationRun(platform, cb, uniqueName, friendlyName, argv[0], args, singleInstance);
}
#if WINDOWS_STORE
using namespace Windows::ApplicationModel::Core;
ref struct ViewProvider sealed : IFrameworkViewSource
{
internal:
ViewProvider(boo::IApplicationCallback& appCb,
SystemStringView uniqueName,
SystemStringView friendlyName,
SystemStringView pname,
Platform::Array<Platform::String^>^ params,
bool singleInstance)
: m_appCb(appCb), m_uniqueName(uniqueName), m_friendlyName(friendlyName),
m_pname(pname), m_singleInstance(singleInstance)
{
SystemChar selfPath[1024];
GetModuleFileNameW(nullptr, selfPath, 1024);
m_args.reserve(params->Length + 1);
m_args.emplace_back(selfPath);
for (Platform::String^ str : params)
m_args.emplace_back(str->Data());
}
public:
virtual IFrameworkView^ CreateView();
internal:
boo::IApplicationCallback& m_appCb;
SystemString m_uniqueName;
SystemString m_friendlyName;
SystemString m_pname;
std::vector<SystemString> m_args;
bool m_singleInstance;
};
#endif
}
#endif // IAPPLICATION_HPP

View File

@ -0,0 +1,46 @@
#ifndef UWPVIEWPROVIDER_HPP
#define UWPVIEWPROVIDER_HPP
#include "IApplication.hpp"
namespace boo
{
#if WINDOWS_STORE
using namespace Windows::ApplicationModel::Core;
ref struct ViewProvider sealed : IFrameworkViewSource
{
internal:
ViewProvider(boo::IApplicationCallback& appCb,
SystemStringView uniqueName,
SystemStringView friendlyName,
SystemStringView pname,
Platform::Array<Platform::String^>^ params,
bool singleInstance)
: m_appCb(appCb), m_uniqueName(uniqueName), m_friendlyName(friendlyName),
m_pname(pname), m_singleInstance(singleInstance)
{
SystemChar selfPath[1024];
GetModuleFileNameW(nullptr, selfPath, 1024);
m_args.reserve(params->Length + 1);
m_args.emplace_back(selfPath);
for (Platform::String^ str : params)
m_args.emplace_back(str->Data());
}
public:
virtual IFrameworkView^ CreateView();
internal:
boo::IApplicationCallback& m_appCb;
SystemString m_uniqueName;
SystemString m_friendlyName;
SystemString m_pname;
std::vector<SystemString> m_args;
bool m_singleInstance;
};
#endif
}
#endif // UWPVIEWPROVIDER_HPP

View File

@ -9,10 +9,16 @@ namespace boo
/** Linked-list iterator shareable by ListNode types. */
template <class T>
class ListIterator : public std::iterator<std::bidirectional_iterator_tag, T>
class ListIterator
{
T* m_node;
public:
using iterator_category = std::bidirectional_iterator_tag;
using value_type = T;
using difference_type = std::ptrdiff_t;
using pointer = T*;
using reference = T&;
explicit ListIterator(T* node) : m_node(node) {}
T& operator*() const { return *m_node; }
bool operator!=(const ListIterator& other) const { return m_node != other.m_node; }

View File

@ -126,10 +126,16 @@ struct GraphicsDataNode : ListNode<GraphicsDataNode<NodeCls, DataCls>, ObjToken<
: ListNode<GraphicsDataNode<NodeCls, DataCls>, ObjToken<DataCls>, NodeCls>(data)
{}
class iterator : public std::iterator<std::bidirectional_iterator_tag, NodeCls>
class iterator
{
GraphicsDataNode<NodeCls, DataCls>* m_node;
public:
using iterator_category = std::bidirectional_iterator_tag;
using value_type = NodeCls;
using difference_type = std::ptrdiff_t;
using pointer = NodeCls*;
using reference = NodeCls&;
explicit iterator(GraphicsDataNode<NodeCls, DataCls>* node) : m_node(node) {}
NodeCls& operator*() const { return *m_node; }
bool operator!=(const iterator& other) const { return m_node != other.m_node; }

View File

@ -3,6 +3,7 @@
using namespace Windows::Foundation;
using namespace Windows::UI::Core;
using namespace Windows::ApplicationModel::Activation;
using namespace Windows::ApplicationModel::Core;
using namespace Platform;
#if _DEBUG
@ -16,6 +17,7 @@ using namespace Platform;
#include "boo/inputdev/DeviceFinder.hpp"
#include "boo/graphicsdev/D3D.hpp"
#include "logvisor/logvisor.hpp"
#include "boo/UWPViewProvider.hpp"
#if _WIN32_WINNT_WIN10
PFN_D3D12_SERIALIZE_ROOT_SIGNATURE D3D12SerializeRootSignaturePROC = nullptr;

View File

@ -616,7 +616,7 @@ soxr_error_t soxr_oneshot(
soxr_quality_spec_t const * q_spec,
soxr_runtime_spec_t const * runtime_spec)
{
soxr_t resampler;
soxr_t resampler = NULL;
soxr_error_t error = q_spec? q_spec->e : 0;
if (!error) {
soxr_quality_spec_t q_spec1;