mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-16 00:17:06 +00:00
UWP support
This commit is contained in:
@@ -81,11 +81,12 @@ ApplicationRun(IApplication::EPlatformType platform,
|
||||
return ApplicationRun(platform, cb, uniqueName, friendlyName, argv[0], args, singleInstance);
|
||||
}
|
||||
|
||||
#if WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP
|
||||
#if WINDOWS_STORE
|
||||
using namespace Windows::ApplicationModel::Core;
|
||||
|
||||
ref struct ViewProvider sealed : IFrameworkViewSource
|
||||
{
|
||||
internal:
|
||||
ViewProvider(boo::IApplicationCallback& appCb,
|
||||
SystemStringView uniqueName,
|
||||
SystemStringView friendlyName,
|
||||
@@ -97,13 +98,15 @@ ref struct ViewProvider sealed : IFrameworkViewSource
|
||||
{
|
||||
SystemChar selfPath[1024];
|
||||
GetModuleFileNameW(nullptr, selfPath, 1024);
|
||||
m_args.reserve(params.size() + 1);
|
||||
m_args.reserve(params->Length + 1);
|
||||
m_args.emplace_back(selfPath);
|
||||
for (Platform::String^ str : params)
|
||||
m_args.emplace_back(str.Data());
|
||||
m_args.emplace_back(str->Data());
|
||||
}
|
||||
IFrameworkView^ CreateView();
|
||||
public:
|
||||
virtual IFrameworkView^ CreateView();
|
||||
|
||||
internal:
|
||||
boo::IApplicationCallback& m_appCb;
|
||||
SystemString m_uniqueName;
|
||||
SystemString m_friendlyName;
|
||||
|
||||
@@ -2,6 +2,13 @@
|
||||
#define BOO_SYSTEM_HPP
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winapifamily.h>
|
||||
#if defined(WINAPI_FAMILY) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP
|
||||
#define WINDOWS_STORE 1
|
||||
#else
|
||||
#define WINDOWS_STORE 0
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include <D3Dcommon.h>
|
||||
#include <wrl/client.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#ifndef GDEV_GL_HPP
|
||||
#define GDEV_GL_HPP
|
||||
#if BOO_HAS_GL
|
||||
|
||||
#include "IGraphicsDataFactory.hpp"
|
||||
#include "IGraphicsCommandQueue.hpp"
|
||||
@@ -62,4 +63,5 @@ public:
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // GDEV_GL_HPP
|
||||
|
||||
@@ -52,7 +52,9 @@ public:
|
||||
|
||||
/* High-Level API */
|
||||
#if _WIN32
|
||||
#if !WINDOWS_STORE
|
||||
const PHIDP_PREPARSED_DATA getReportDescriptor();
|
||||
#endif
|
||||
#else
|
||||
std::vector<uint8_t> getReportDescriptor();
|
||||
#endif
|
||||
|
||||
@@ -181,9 +181,11 @@ private:
|
||||
|
||||
ParserStatus m_status = ParserStatus::OK;
|
||||
#if _WIN32
|
||||
#if !WINDOWS_STORE
|
||||
std::vector<HIDMainItem> m_itemPool;
|
||||
mutable std::vector<HIDP_DATA> m_dataList;
|
||||
PHIDP_PREPARSED_DATA m_descriptorData = nullptr;
|
||||
#endif
|
||||
#else
|
||||
std::unique_ptr<HIDMainItem[]> m_itemPool;
|
||||
using Report = std::pair<uint32_t, std::pair<uint32_t, uint32_t>>;
|
||||
@@ -201,7 +203,9 @@ private:
|
||||
|
||||
public:
|
||||
#if _WIN32
|
||||
#if !WINDOWS_STORE
|
||||
ParserStatus Parse(const PHIDP_PREPARSED_DATA descriptorData);
|
||||
#endif
|
||||
#else
|
||||
ParserStatus Parse(const uint8_t* descriptorData, size_t len);
|
||||
static size_t CalculateMaxInputReportSize(const uint8_t* descriptorData, size_t len);
|
||||
|
||||
@@ -15,7 +15,7 @@ class DeviceFinder;
|
||||
class IHIDListener
|
||||
{
|
||||
public:
|
||||
virtual ~IHIDListener() {}
|
||||
virtual ~IHIDListener() = default;
|
||||
|
||||
/* Automatic device scanning */
|
||||
virtual bool startScanning()=0;
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
/* Manual device scanning */
|
||||
virtual bool scanNow()=0;
|
||||
|
||||
#if _WIN32
|
||||
#if _WIN32 && !WINDOWS_STORE
|
||||
/* External listener implementation (for Windows) */
|
||||
virtual bool _extDevConnect(const char* path)=0;
|
||||
virtual bool _extDevDisconnect(const char* path)=0;
|
||||
|
||||
Reference in New Issue
Block a user