Merge pull request #7834 from krzys-h/uwp

UWP and Xbox One port
This commit is contained in:
Twinaphex 2018-12-29 01:15:27 +01:00 committed by GitHub
commit f82b6e07ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
75 changed files with 4129 additions and 538 deletions

View File

@ -142,6 +142,7 @@ JuanVCS
Justin Jacobs (dorkster)
Justin Weiss (justinweiss)
Ken Rossato (rossato)
Krzysztof Haładyn (krzys_h)
kurumushi
kwyxz
l3iggs

View File

@ -222,8 +222,13 @@ static xaudio2_t *xaudio2_new(unsigned samplerate, unsigned channels,
if (FAILED(XAudio2Create(&handle->pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR)))
goto error;
#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)
if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, device, NULL, AudioCategory_GameEffects)))
goto error;
#else
if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, device, NULL)))
goto error;
#endif
xaudio2_set_wavefmt(&wfx, channels, samplerate);

View File

@ -1,7 +1,5 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2017 - Daniel De Matteis
* Copyright (C) 2010-2014 - OV2
* Copyright (C) 2018 - Krzysztof Haładyn
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
@ -15,350 +13,14 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
/* Kinda stripped down. Only contains the bare essentials used in RetroArch. */
#ifndef XAUDIO2_STRIPPED_H
#define XAUDIO2_STRIPPED_H
#include <retro_inline.h>
#include <retro_environment.h>
/* All structures defined in this file use tight field packing */
#pragma pack(push, 1)
#if defined(__cplusplus) && !defined(CINTERFACE)
#define X2DEFAULT(x) = (x)
#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)
/* XAudio 2.7 it part of the old DirectX SDKs. XAudio 2.8+ is part of the
* Windows OS itself (starting from Windows 8). Since UWP lets you access
* only libraries that are built-in to the OS, the headers had to be
* upgraded to the newer version to get audio support working. */
#include "xaudio29.h"
#else
#define X2DEFAULT(x)
/* The old version still has to be there since XAudio 2.8 is not available
* on Windows 7 and earlier */
#include "xaudio27.h"
#endif
#ifdef _XBOX
#include <xtl.h>
#ifndef __cplusplus
#define OPAQUE interface
#endif
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
DEFINE_GUID(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
DEFINE_GUID(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
DEFINE_CLSID(XAudio2, 3eda9b49, 2085, 498b, 9b, b2, 39, a6, 77, 84, 93, de);
DEFINE_CLSID(XAudio2_Debug, 47199894, 7cc2, 444d, 98, 73, ce, d2, 56, 2c, c6, 0e);
DEFINE_IID(IXAudio2, 8bcf1f58, 9fe7, 4583, 8a, c6, e2, ad, c4, 65, c8, bb);
#include <audiodefs.h> /* Basic audio data types and constants */
#else
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <basetyps.h>
#include <objbase.h>
#include <mmreg.h>
#ifndef __cplusplus
#undef OPAQUE
#define OPAQUE struct
#endif
#define DEFINE_GUID_X(n, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
static const GUID n = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
#define DEFINE_CLSID_X(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
DEFINE_GUID_X(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
#define DEFINE_IID_X(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
DEFINE_GUID_X(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
#ifndef __cplusplus
#ifndef INTERFACE
#define INTERFACE void
#endif
#endif
DEFINE_CLSID_X(XAudio2, 5a508685, a254, 4fba, 9b, 82, 9a, 24, b0, 03, 06, af); /* 2.7 */
DEFINE_IID_X(IXAudio2, 8bcf1f58, 9fe7, 4583, 8a, c6, e2, ad, c4, 65, c8, bb);
#endif
#ifdef _XBOX
#define XAUDIO2_DEFAULT_FREQ_RATIO 2.0f
#else
#define XAUDIO2_DEFAULT_FREQ_RATIO 4.0f
#endif
#define XAUDIO2_COMMIT_NOW 0
#define XAUDIO2_DEFAULT_CHANNELS 0
#define XAUDIO2_DEFAULT_SAMPLERATE 0
#define XAUDIO2_DEBUG_ENGINE 0x0001
#define XAUDIO2_VOICE_NOSRC 0x0004
typedef enum XAUDIO2_DEVICE_ROLE
{
NotDefaultDevice = 0x0,
DefaultConsoleDevice = 0x1,
DefaultMultimediaDevice = 0x2,
DefaultCommunicationsDevice = 0x4,
DefaultGameDevice = 0x8,
GlobalDefaultDevice = 0xf,
InvalidDeviceRole = ~GlobalDefaultDevice
} XAUDIO2_DEVICE_ROLE;
#ifdef _XBOX
typedef enum XAUDIO2_XBOX_HWTHREAD_SPECIFIER
{
XboxThread0 = 0x01,
XboxThread1 = 0x02,
XboxThread2 = 0x04,
XboxThread3 = 0x08,
XboxThread4 = 0x10,
XboxThread5 = 0x20,
XAUDIO2_ANY_PROCESSOR = XboxThread4,
XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR
} XAUDIO2_XBOX_HWTHREAD_SPECIFIER, XAUDIO2_PROCESSOR;
#else
typedef enum XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER
{
#if defined(__STDC_C89__)
XAUDIO2_ANY_PROCESSOR = 0xffff,
#else
XAUDIO2_ANY_PROCESSOR = 0xffffffff,
#endif
XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR
} XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER, XAUDIO2_PROCESSOR;
#endif
typedef enum XAUDIO2_FILTER_TYPE {
LowPassFilter,
BandPassFilter,
HighPassFilter
} XAUDIO2_FILTER_TYPE;
typedef struct XAUDIO2_DEVICE_DETAILS
{
WCHAR DeviceID[256];
WCHAR DisplayName[256];
XAUDIO2_DEVICE_ROLE Role;
WAVEFORMATEXTENSIBLE OutputFormat;
} XAUDIO2_DEVICE_DETAILS;
/* Forward declarations. */
#ifdef __cplusplus
struct XAUDIO2_VOICE_DETAILS;
struct XAUDIO2_VOICE_SENDS;
struct XAUDIO2_EFFECT_DESCRIPTOR;
struct XAUDIO2_EFFECT_CHAIN;
struct XAUDIO2_FILTER_PARAMETERS;
struct XAUDIO2_BUFFER_WMA;
struct XAUDIO2_VOICE_STATE;
struct XAUDIO2_PERFORMANCE_DATA;
struct XAUDIO2_DEBUG_CONFIGURATION;
struct IXAudio2EngineCallback;
struct IXAudio2SubmixVoice;
#else
typedef OPAQUE XAUDIO2_VOICE_DETAILS XAUDIO2_VOICE_DETAILS;
typedef OPAQUE XAUDIO2_VOICE_SENDS XAUDIO2_VOICE_SENDS;
typedef OPAQUE XAUDIO2_EFFECT_DESCRIPTOR XAUDIO2_EFFECT_DESCRIPTOR;
typedef OPAQUE XAUDIO2_EFFECT_CHAIN XAUDIO2_EFFECT_CHAIN;
typedef OPAQUE XAUDIO2_FILTER_PARAMETERS XAUDIO2_FILTER_PARAMETERS;
typedef OPAQUE XAUDIO2_BUFFER_WMA XAUDIO2_BUFFER_WMA;
typedef OPAQUE XAUDIO2_VOICE_STATE XAUDIO2_VOICE_STATE;
typedef OPAQUE XAUDIO2_PERFORMANCE_DATA XAUDIO2_PERFORMANCE_DATA;
typedef OPAQUE XAUDIO2_DEBUG_CONFIGURATION XAUDIO2_DEBUG_CONFIGURATION;
typedef OPAQUE IXAudio2EngineCallback IXAudio2EngineCallback;
typedef OPAQUE IXAudio2SubmixVoice IXAudio2SubmixVoice;
#endif
typedef struct XAUDIO2_BUFFER
{
UINT32 Flags;
UINT32 AudioBytes;
const BYTE* pAudioData;
UINT32 PlayBegin;
UINT32 PlayLength;
UINT32 LoopBegin;
UINT32 LoopLength;
UINT32 LoopCount;
void *pContext;
} XAUDIO2_BUFFER;
#undef INTERFACE
#define INTERFACE IXAudio2VoiceCallback
DECLARE_INTERFACE(IXAudio2VoiceCallback)
{
STDMETHOD_(void, OnVoiceProcessingPassStart) (THIS_ UINT32 BytesRequired) PURE;
STDMETHOD_(void, OnVoiceProcessingPassEnd) (THIS) PURE;
STDMETHOD_(void, OnStreamEnd) (THIS) PURE;
STDMETHOD_(void, OnBufferStart) (THIS_ void *pBufferContext) PURE;
STDMETHOD_(void, OnBufferEnd) (THIS_ void *pBufferContext) PURE;
STDMETHOD_(void, OnLoopEnd) (THIS_ void *pBufferContext) PURE;
STDMETHOD_(void, OnVoiceError) (THIS_ void *pBufferContext, HRESULT Error) PURE;
};
#undef INTERFACE
#define INTERFACE IXAudio2Voice
DECLARE_INTERFACE(IXAudio2Voice)
{
#define Declare_IXAudio2Voice_Methods() \
STDMETHOD_(void, GetVoiceDetails) (THIS_ XAUDIO2_VOICE_DETAILS* pVoiceDetails) PURE; \
STDMETHOD(SetOutputVoices) (THIS_ const XAUDIO2_VOICE_SENDS* pSendList) PURE; \
STDMETHOD(SetEffectChain) (THIS_ const XAUDIO2_EFFECT_CHAIN* pEffectChain) PURE; \
STDMETHOD(EnableEffect) (THIS_ UINT32 EffectIndex, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD(DisableEffect) (THIS_ UINT32 EffectIndex, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD_(void, GetEffectState) (THIS_ UINT32 EffectIndex, BOOL* pEnabled) PURE; \
STDMETHOD(SetEffectParameters) (THIS_ UINT32 EffectIndex, \
const void *pParameters, \
UINT32 ParametersByteSize, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD(GetEffectParameters) (THIS_ UINT32 EffectIndex, void *pParameters, \
UINT32 ParametersByteSize) PURE; \
STDMETHOD(SetFilterParameters) (THIS_ const XAUDIO2_FILTER_PARAMETERS* pParameters, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD_(void, GetFilterParameters) (THIS_ XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \
STDMETHOD_(void, SetOutputFilterParameters) (THIS_ IXAudio2Voice *voice, const XAUDIO2_FILTER_PARAMETERS* param, \
UINT32 op X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD_(void, GetOutputFilterParameters) (THIS_ IXAudio2Voice *voice, XAUDIO2_FILTER_PARAMETERS* param) PURE; \
STDMETHOD(SetVolume) (THIS_ float Volume, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD_(void, GetVolume) (THIS_ float* pVolume) PURE; \
STDMETHOD(SetChannelVolumes) (THIS_ UINT32 Channels, const float* pVolumes, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD_(void, GetChannelVolumes) (THIS_ UINT32 Channels, float* pVolumes) PURE; \
STDMETHOD(SetOutputMatrix) (THIS_ IXAudio2Voice* pDestinationVoice, \
UINT32 SourceChannels, UINT32 DestinationChannels, \
const float* pLevelMatrix, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD_(void, GetOutputMatrix) (THIS_ IXAudio2Voice* pDestinationVoice, \
UINT32 SourceChannels, UINT32 DestinationChannels, \
float* pLevelMatrix) PURE; \
STDMETHOD_(void, DestroyVoice) (THIS) PURE
Declare_IXAudio2Voice_Methods();
};
#undef INTERFACE
#define INTERFACE IXAudio2MasteringVoice
DECLARE_INTERFACE_(IXAudio2MasteringVoice, IXAudio2Voice)
{
Declare_IXAudio2Voice_Methods();
};
#undef INTERFACE
#define INTERFACE IXAudio2SourceVoice
DECLARE_INTERFACE_(IXAudio2SourceVoice, IXAudio2Voice)
{
Declare_IXAudio2Voice_Methods();
STDMETHOD(Start) (THIS_ UINT32 Flags, UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
STDMETHOD(Stop) (THIS_ UINT32 Flags, UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
STDMETHOD(SubmitSourceBuffer) (THIS_ const XAUDIO2_BUFFER* pBuffer, const XAUDIO2_BUFFER_WMA* pBufferWMA X2DEFAULT(NULL)) PURE;
STDMETHOD(FlushSourceBuffers) (THIS) PURE;
STDMETHOD(Discontinuity) (THIS) PURE;
STDMETHOD(ExitLoop) (THIS_ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
STDMETHOD_(void, GetState) (THIS_ XAUDIO2_VOICE_STATE* pVoiceState) PURE;
STDMETHOD(SetFrequencyRatio) (THIS_ float Ratio,
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
STDMETHOD_(void, GetFrequencyRatio) (THIS_ float* pRatio) PURE;
};
#undef INTERFACE
#define INTERFACE IXAudio2
DECLARE_INTERFACE_(IXAudio2, IUnknown)
{
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvInterface) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
STDMETHOD(GetDeviceCount) (THIS_ UINT32* pCount) PURE;
STDMETHOD(GetDeviceDetails) (THIS_ UINT32 Index, XAUDIO2_DEVICE_DETAILS* pDeviceDetails) PURE;
STDMETHOD(Initialize) (THIS_ UINT32 Flags X2DEFAULT(0),
XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)) PURE;
STDMETHOD(RegisterForCallbacks) (IXAudio2EngineCallback* pCallback) PURE;
STDMETHOD_(void, UnregisterForCallbacks) (IXAudio2EngineCallback* pCallback) PURE;
STDMETHOD(CreateSourceVoice) (THIS_ IXAudio2SourceVoice** ppSourceVoice,
const WAVEFORMATEX* pSourceFormat,
UINT32 Flags X2DEFAULT(0),
float MaxFrequencyRatio X2DEFAULT(XAUDIO2_DEFAULT_FREQ_RATIO),
IXAudio2VoiceCallback* pCallback X2DEFAULT(NULL),
const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL),
const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE;
STDMETHOD(CreateSubmixVoice) (THIS_ IXAudio2SubmixVoice** ppSubmixVoice,
UINT32 InputChannels, UINT32 InputSampleRate,
UINT32 Flags X2DEFAULT(0), UINT32 ProcessingStage X2DEFAULT(0),
const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL),
const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE;
STDMETHOD(CreateMasteringVoice) (THIS_ IXAudio2MasteringVoice** ppMasteringVoice,
UINT32 InputChannels X2DEFAULT(XAUDIO2_DEFAULT_CHANNELS),
UINT32 InputSampleRate X2DEFAULT(XAUDIO2_DEFAULT_SAMPLERATE),
UINT32 Flags X2DEFAULT(0), UINT32 DeviceIndex X2DEFAULT(0),
const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE;
STDMETHOD(StartEngine) (THIS) PURE;
STDMETHOD_(void, StopEngine) (THIS) PURE;
STDMETHOD(CommitChanges) (THIS_ UINT32 OperationSet) PURE;
STDMETHOD_(void, GetPerformanceData) (THIS_ XAUDIO2_PERFORMANCE_DATA* pPerfData) PURE;
STDMETHOD_(void, SetDebugConfiguration) (THIS_ const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
void *pReserved X2DEFAULT(NULL)) PURE;
};
#if defined(__cplusplus) && !defined(CINTERFACE)
/* C++ hooks */
#define IXAudio2_Initialize(handle,a,b) handle->Initialize(a, b)
#define IXAudio2SourceVoice_SubmitSourceBuffer(handle, a, b) handle->SubmitSourceBuffer(a, b)
#define IXAudio2SourceVoice_Stop(handle, a, b) handle->Stop(a, b)
#define IXAudio2SourceVoice_DestroyVoice(handle) handle->DestroyVoice()
#define IXAudio2MasteringVoice_DestroyVoice(handle) handle->DestroyVoice()
#define IXAudio2_Release(handle) handle->Release()
#define IXAudio2_CreateSourceVoice(handle, a, b, c, d, e, f, g) handle->CreateSourceVoice(a, b, c, d, e, f, g)
#define IXAudio2_CreateMasteringVoice(handle, a, b, c, d, e, f) handle->CreateMasteringVoice(a, b, c, d, e, f)
#define IXAudio2SourceVoice_Start(handle, a, b) handle->Start(a, b)
#else
/* C hooks */
#define IXAudio2_Initialize(handle,a,b) (handle)->lpVtbl->Initialize(handle, a, b)
#define IXAudio2_Release(handle) (handle)->lpVtbl->Release(handle)
#define IXAudio2_CreateSourceVoice(handle,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain) (handle)->lpVtbl->CreateSourceVoice(handle, ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain)
#define IXAudio2_CreateMasteringVoice(handle,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain) (handle)->lpVtbl->CreateMasteringVoice(handle, ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain)
#define IXAudio2_GetDeviceCount(handle, puCount) (handle)->lpVtbl->GetDeviceCount(handle, puCount)
#define IXAudio2_GetDeviceDetails(handle, Index,pDeviceDetails) (handle)->lpVtbl->GetDeviceDetails(handle, Index, pDeviceDetails)
#define IXAudio2SourceVoice_Start(handle, Flags, OperationSet) (handle)->lpVtbl->Start(handle, Flags, OperationSet)
#define IXAudio2SourceVoice_Stop(handle, Flags, OperationSet) (handle)->lpVtbl->Stop(handle, Flags, OperationSet)
#define IXAudio2SourceVoice_SubmitSourceBuffer(handle, pBuffer, pBufferWMA) (handle)->lpVtbl->SubmitSourceBuffer(handle, pBuffer, pBufferWMA)
#define IXAudio2SourceVoice_DestroyVoice(handle) (handle)->lpVtbl->DestroyVoice(handle)
#define IXAudio2MasteringVoice_DestroyVoice(handle) (handle)->lpVtbl->DestroyVoice(handle)
#endif
#ifdef _XBOX
STDAPI XAudio2Create(__deref_out IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0),
XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR));
#else
static INLINE HRESULT XAudio2Create(IXAudio2 **ppXAudio2, UINT32 flags, XAUDIO2_PROCESSOR proc)
{
IXAudio2 *pXAudio2 = NULL;
#ifdef __cplusplus
HRESULT hr = CoCreateInstance(CLSID_XAudio2, NULL, CLSCTX_INPROC_SERVER, IID_IXAudio2, (void**)&pXAudio2);
#else
HRESULT hr = CoCreateInstance(&CLSID_XAudio2, NULL, CLSCTX_INPROC_SERVER, &IID_IXAudio2, (void**)&pXAudio2);
#endif
if (SUCCEEDED(hr))
{
hr = IXAudio2_Initialize(pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR);
if (SUCCEEDED(hr))
*ppXAudio2 = pXAudio2;
else
IXAudio2_Release(pXAudio2);
}
return hr;
}
#endif
/* Undo the #pragma pack(push, 1) directive at the top of this file */
#pragma pack(pop)
#endif

364
audio/drivers/xaudio27.h Normal file
View File

@ -0,0 +1,364 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2017 - Daniel De Matteis
* Copyright (C) 2010-2014 - OV2
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
/* Kinda stripped down. Only contains the bare essentials used in RetroArch. */
#ifndef XAUDIO2_STRIPPED_H
#define XAUDIO2_STRIPPED_H
#include <retro_inline.h>
#include <retro_environment.h>
/* All structures defined in this file use tight field packing */
#pragma pack(push, 1)
#if defined(__cplusplus) && !defined(CINTERFACE)
#define X2DEFAULT(x) = (x)
#else
#define X2DEFAULT(x)
#endif
#ifdef _XBOX
#include <xtl.h>
#ifndef __cplusplus
#define OPAQUE interface
#endif
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
DEFINE_GUID(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
DEFINE_GUID(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
DEFINE_CLSID(XAudio2, 3eda9b49, 2085, 498b, 9b, b2, 39, a6, 77, 84, 93, de);
DEFINE_CLSID(XAudio2_Debug, 47199894, 7cc2, 444d, 98, 73, ce, d2, 56, 2c, c6, 0e);
DEFINE_IID(IXAudio2, 8bcf1f58, 9fe7, 4583, 8a, c6, e2, ad, c4, 65, c8, bb);
#include <audiodefs.h> /* Basic audio data types and constants */
#else
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <basetyps.h>
#include <objbase.h>
#include <mmreg.h>
#ifndef __cplusplus
#undef OPAQUE
#define OPAQUE struct
#endif
#define DEFINE_GUID_X(n, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
static const GUID n = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
#define DEFINE_CLSID_X(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
DEFINE_GUID_X(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
#define DEFINE_IID_X(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
DEFINE_GUID_X(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
#ifndef __cplusplus
#ifndef INTERFACE
#define INTERFACE void
#endif
#endif
DEFINE_CLSID_X(XAudio2, 5a508685, a254, 4fba, 9b, 82, 9a, 24, b0, 03, 06, af); /* 2.7 */
DEFINE_IID_X(IXAudio2, 8bcf1f58, 9fe7, 4583, 8a, c6, e2, ad, c4, 65, c8, bb);
#endif
#ifdef _XBOX
#define XAUDIO2_DEFAULT_FREQ_RATIO 2.0f
#else
#define XAUDIO2_DEFAULT_FREQ_RATIO 4.0f
#endif
#define XAUDIO2_COMMIT_NOW 0
#define XAUDIO2_DEFAULT_CHANNELS 0
#define XAUDIO2_DEFAULT_SAMPLERATE 0
#define XAUDIO2_DEBUG_ENGINE 0x0001
#define XAUDIO2_VOICE_NOSRC 0x0004
typedef enum XAUDIO2_DEVICE_ROLE
{
NotDefaultDevice = 0x0,
DefaultConsoleDevice = 0x1,
DefaultMultimediaDevice = 0x2,
DefaultCommunicationsDevice = 0x4,
DefaultGameDevice = 0x8,
GlobalDefaultDevice = 0xf,
InvalidDeviceRole = ~GlobalDefaultDevice
} XAUDIO2_DEVICE_ROLE;
#ifdef _XBOX
typedef enum XAUDIO2_XBOX_HWTHREAD_SPECIFIER
{
XboxThread0 = 0x01,
XboxThread1 = 0x02,
XboxThread2 = 0x04,
XboxThread3 = 0x08,
XboxThread4 = 0x10,
XboxThread5 = 0x20,
XAUDIO2_ANY_PROCESSOR = XboxThread4,
XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR
} XAUDIO2_XBOX_HWTHREAD_SPECIFIER, XAUDIO2_PROCESSOR;
#else
typedef enum XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER
{
#if defined(__STDC_C89__)
XAUDIO2_ANY_PROCESSOR = 0xffff,
#else
XAUDIO2_ANY_PROCESSOR = 0xffffffff,
#endif
XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR
} XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER, XAUDIO2_PROCESSOR;
#endif
typedef enum XAUDIO2_FILTER_TYPE {
LowPassFilter,
BandPassFilter,
HighPassFilter
} XAUDIO2_FILTER_TYPE;
typedef struct XAUDIO2_DEVICE_DETAILS
{
WCHAR DeviceID[256];
WCHAR DisplayName[256];
XAUDIO2_DEVICE_ROLE Role;
WAVEFORMATEXTENSIBLE OutputFormat;
} XAUDIO2_DEVICE_DETAILS;
/* Forward declarations. */
#ifdef __cplusplus
struct XAUDIO2_VOICE_DETAILS;
struct XAUDIO2_VOICE_SENDS;
struct XAUDIO2_EFFECT_DESCRIPTOR;
struct XAUDIO2_EFFECT_CHAIN;
struct XAUDIO2_FILTER_PARAMETERS;
struct XAUDIO2_BUFFER_WMA;
struct XAUDIO2_VOICE_STATE;
struct XAUDIO2_PERFORMANCE_DATA;
struct XAUDIO2_DEBUG_CONFIGURATION;
struct IXAudio2EngineCallback;
struct IXAudio2SubmixVoice;
#else
typedef OPAQUE XAUDIO2_VOICE_DETAILS XAUDIO2_VOICE_DETAILS;
typedef OPAQUE XAUDIO2_VOICE_SENDS XAUDIO2_VOICE_SENDS;
typedef OPAQUE XAUDIO2_EFFECT_DESCRIPTOR XAUDIO2_EFFECT_DESCRIPTOR;
typedef OPAQUE XAUDIO2_EFFECT_CHAIN XAUDIO2_EFFECT_CHAIN;
typedef OPAQUE XAUDIO2_FILTER_PARAMETERS XAUDIO2_FILTER_PARAMETERS;
typedef OPAQUE XAUDIO2_BUFFER_WMA XAUDIO2_BUFFER_WMA;
typedef OPAQUE XAUDIO2_VOICE_STATE XAUDIO2_VOICE_STATE;
typedef OPAQUE XAUDIO2_PERFORMANCE_DATA XAUDIO2_PERFORMANCE_DATA;
typedef OPAQUE XAUDIO2_DEBUG_CONFIGURATION XAUDIO2_DEBUG_CONFIGURATION;
typedef OPAQUE IXAudio2EngineCallback IXAudio2EngineCallback;
typedef OPAQUE IXAudio2SubmixVoice IXAudio2SubmixVoice;
#endif
typedef struct XAUDIO2_BUFFER
{
UINT32 Flags;
UINT32 AudioBytes;
const BYTE* pAudioData;
UINT32 PlayBegin;
UINT32 PlayLength;
UINT32 LoopBegin;
UINT32 LoopLength;
UINT32 LoopCount;
void *pContext;
} XAUDIO2_BUFFER;
#undef INTERFACE
#define INTERFACE IXAudio2VoiceCallback
DECLARE_INTERFACE(IXAudio2VoiceCallback)
{
STDMETHOD_(void, OnVoiceProcessingPassStart) (THIS_ UINT32 BytesRequired) PURE;
STDMETHOD_(void, OnVoiceProcessingPassEnd) (THIS) PURE;
STDMETHOD_(void, OnStreamEnd) (THIS) PURE;
STDMETHOD_(void, OnBufferStart) (THIS_ void *pBufferContext) PURE;
STDMETHOD_(void, OnBufferEnd) (THIS_ void *pBufferContext) PURE;
STDMETHOD_(void, OnLoopEnd) (THIS_ void *pBufferContext) PURE;
STDMETHOD_(void, OnVoiceError) (THIS_ void *pBufferContext, HRESULT Error) PURE;
};
#undef INTERFACE
#define INTERFACE IXAudio2Voice
DECLARE_INTERFACE(IXAudio2Voice)
{
#define Declare_IXAudio2Voice_Methods() \
STDMETHOD_(void, GetVoiceDetails) (THIS_ XAUDIO2_VOICE_DETAILS* pVoiceDetails) PURE; \
STDMETHOD(SetOutputVoices) (THIS_ const XAUDIO2_VOICE_SENDS* pSendList) PURE; \
STDMETHOD(SetEffectChain) (THIS_ const XAUDIO2_EFFECT_CHAIN* pEffectChain) PURE; \
STDMETHOD(EnableEffect) (THIS_ UINT32 EffectIndex, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD(DisableEffect) (THIS_ UINT32 EffectIndex, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD_(void, GetEffectState) (THIS_ UINT32 EffectIndex, BOOL* pEnabled) PURE; \
STDMETHOD(SetEffectParameters) (THIS_ UINT32 EffectIndex, \
const void *pParameters, \
UINT32 ParametersByteSize, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD(GetEffectParameters) (THIS_ UINT32 EffectIndex, void *pParameters, \
UINT32 ParametersByteSize) PURE; \
STDMETHOD(SetFilterParameters) (THIS_ const XAUDIO2_FILTER_PARAMETERS* pParameters, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD_(void, GetFilterParameters) (THIS_ XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \
STDMETHOD_(void, SetOutputFilterParameters) (THIS_ IXAudio2Voice *voice, const XAUDIO2_FILTER_PARAMETERS* param, \
UINT32 op X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD_(void, GetOutputFilterParameters) (THIS_ IXAudio2Voice *voice, XAUDIO2_FILTER_PARAMETERS* param) PURE; \
STDMETHOD(SetVolume) (THIS_ float Volume, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD_(void, GetVolume) (THIS_ float* pVolume) PURE; \
STDMETHOD(SetChannelVolumes) (THIS_ UINT32 Channels, const float* pVolumes, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD_(void, GetChannelVolumes) (THIS_ UINT32 Channels, float* pVolumes) PURE; \
STDMETHOD(SetOutputMatrix) (THIS_ IXAudio2Voice* pDestinationVoice, \
UINT32 SourceChannels, UINT32 DestinationChannels, \
const float* pLevelMatrix, \
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
STDMETHOD_(void, GetOutputMatrix) (THIS_ IXAudio2Voice* pDestinationVoice, \
UINT32 SourceChannels, UINT32 DestinationChannels, \
float* pLevelMatrix) PURE; \
STDMETHOD_(void, DestroyVoice) (THIS) PURE
Declare_IXAudio2Voice_Methods();
};
#undef INTERFACE
#define INTERFACE IXAudio2MasteringVoice
DECLARE_INTERFACE_(IXAudio2MasteringVoice, IXAudio2Voice)
{
Declare_IXAudio2Voice_Methods();
};
#undef INTERFACE
#define INTERFACE IXAudio2SourceVoice
DECLARE_INTERFACE_(IXAudio2SourceVoice, IXAudio2Voice)
{
Declare_IXAudio2Voice_Methods();
STDMETHOD(Start) (THIS_ UINT32 Flags, UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
STDMETHOD(Stop) (THIS_ UINT32 Flags, UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
STDMETHOD(SubmitSourceBuffer) (THIS_ const XAUDIO2_BUFFER* pBuffer, const XAUDIO2_BUFFER_WMA* pBufferWMA X2DEFAULT(NULL)) PURE;
STDMETHOD(FlushSourceBuffers) (THIS) PURE;
STDMETHOD(Discontinuity) (THIS) PURE;
STDMETHOD(ExitLoop) (THIS_ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
STDMETHOD_(void, GetState) (THIS_ XAUDIO2_VOICE_STATE* pVoiceState) PURE;
STDMETHOD(SetFrequencyRatio) (THIS_ float Ratio,
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
STDMETHOD_(void, GetFrequencyRatio) (THIS_ float* pRatio) PURE;
};
#undef INTERFACE
#define INTERFACE IXAudio2
DECLARE_INTERFACE_(IXAudio2, IUnknown)
{
STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvInterface) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
STDMETHOD(GetDeviceCount) (THIS_ UINT32* pCount) PURE;
STDMETHOD(GetDeviceDetails) (THIS_ UINT32 Index, XAUDIO2_DEVICE_DETAILS* pDeviceDetails) PURE;
STDMETHOD(Initialize) (THIS_ UINT32 Flags X2DEFAULT(0),
XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)) PURE;
STDMETHOD(RegisterForCallbacks) (IXAudio2EngineCallback* pCallback) PURE;
STDMETHOD_(void, UnregisterForCallbacks) (IXAudio2EngineCallback* pCallback) PURE;
STDMETHOD(CreateSourceVoice) (THIS_ IXAudio2SourceVoice** ppSourceVoice,
const WAVEFORMATEX* pSourceFormat,
UINT32 Flags X2DEFAULT(0),
float MaxFrequencyRatio X2DEFAULT(XAUDIO2_DEFAULT_FREQ_RATIO),
IXAudio2VoiceCallback* pCallback X2DEFAULT(NULL),
const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL),
const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE;
STDMETHOD(CreateSubmixVoice) (THIS_ IXAudio2SubmixVoice** ppSubmixVoice,
UINT32 InputChannels, UINT32 InputSampleRate,
UINT32 Flags X2DEFAULT(0), UINT32 ProcessingStage X2DEFAULT(0),
const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL),
const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE;
STDMETHOD(CreateMasteringVoice) (THIS_ IXAudio2MasteringVoice** ppMasteringVoice,
UINT32 InputChannels X2DEFAULT(XAUDIO2_DEFAULT_CHANNELS),
UINT32 InputSampleRate X2DEFAULT(XAUDIO2_DEFAULT_SAMPLERATE),
UINT32 Flags X2DEFAULT(0), UINT32 DeviceIndex X2DEFAULT(0),
const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE;
STDMETHOD(StartEngine) (THIS) PURE;
STDMETHOD_(void, StopEngine) (THIS) PURE;
STDMETHOD(CommitChanges) (THIS_ UINT32 OperationSet) PURE;
STDMETHOD_(void, GetPerformanceData) (THIS_ XAUDIO2_PERFORMANCE_DATA* pPerfData) PURE;
STDMETHOD_(void, SetDebugConfiguration) (THIS_ const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
void *pReserved X2DEFAULT(NULL)) PURE;
};
#if defined(__cplusplus) && !defined(CINTERFACE)
/* C++ hooks */
#define IXAudio2_Initialize(handle,a,b) handle->Initialize(a, b)
#define IXAudio2SourceVoice_SubmitSourceBuffer(handle, a, b) handle->SubmitSourceBuffer(a, b)
#define IXAudio2SourceVoice_Stop(handle, a, b) handle->Stop(a, b)
#define IXAudio2SourceVoice_DestroyVoice(handle) handle->DestroyVoice()
#define IXAudio2MasteringVoice_DestroyVoice(handle) handle->DestroyVoice()
#define IXAudio2_Release(handle) handle->Release()
#define IXAudio2_CreateSourceVoice(handle, a, b, c, d, e, f, g) handle->CreateSourceVoice(a, b, c, d, e, f, g)
#define IXAudio2_CreateMasteringVoice(handle, a, b, c, d, e, f) handle->CreateMasteringVoice(a, b, c, d, e, f)
#define IXAudio2SourceVoice_Start(handle, a, b) handle->Start(a, b)
#else
/* C hooks */
#define IXAudio2_Initialize(handle,a,b) (handle)->lpVtbl->Initialize(handle, a, b)
#define IXAudio2_Release(handle) (handle)->lpVtbl->Release(handle)
#define IXAudio2_CreateSourceVoice(handle,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain) (handle)->lpVtbl->CreateSourceVoice(handle, ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain)
#define IXAudio2_CreateMasteringVoice(handle,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain) (handle)->lpVtbl->CreateMasteringVoice(handle, ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain)
#define IXAudio2_GetDeviceCount(handle, puCount) (handle)->lpVtbl->GetDeviceCount(handle, puCount)
#define IXAudio2_GetDeviceDetails(handle, Index,pDeviceDetails) (handle)->lpVtbl->GetDeviceDetails(handle, Index, pDeviceDetails)
#define IXAudio2SourceVoice_Start(handle, Flags, OperationSet) (handle)->lpVtbl->Start(handle, Flags, OperationSet)
#define IXAudio2SourceVoice_Stop(handle, Flags, OperationSet) (handle)->lpVtbl->Stop(handle, Flags, OperationSet)
#define IXAudio2SourceVoice_SubmitSourceBuffer(handle, pBuffer, pBufferWMA) (handle)->lpVtbl->SubmitSourceBuffer(handle, pBuffer, pBufferWMA)
#define IXAudio2SourceVoice_DestroyVoice(handle) (handle)->lpVtbl->DestroyVoice(handle)
#define IXAudio2MasteringVoice_DestroyVoice(handle) (handle)->lpVtbl->DestroyVoice(handle)
#endif
#ifdef _XBOX
STDAPI XAudio2Create(__deref_out IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0),
XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR));
#else
static INLINE HRESULT XAudio2Create(IXAudio2 **ppXAudio2, UINT32 flags, XAUDIO2_PROCESSOR proc)
{
IXAudio2 *pXAudio2 = NULL;
#ifdef __cplusplus
HRESULT hr = CoCreateInstance(CLSID_XAudio2, NULL, CLSCTX_INPROC_SERVER, IID_IXAudio2, (void**)&pXAudio2);
#else
HRESULT hr = CoCreateInstance(&CLSID_XAudio2, NULL, CLSCTX_INPROC_SERVER, &IID_IXAudio2, (void**)&pXAudio2);
#endif
if (SUCCEEDED(hr))
{
hr = IXAudio2_Initialize(pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR);
if (SUCCEEDED(hr))
*ppXAudio2 = pXAudio2;
else
IXAudio2_Release(pXAudio2);
}
return hr;
}
#endif
/* Undo the #pragma pack(push, 1) directive at the top of this file */
#pragma pack(pop)
#endif

1313
audio/drivers/xaudio29.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -56,6 +56,10 @@
#include "record/record_driver.h"
#ifdef __WINRT__
#include "uwp/uwp_func.h"
#endif
static const char* invalid_filename_chars[] = {
/* https://support.microsoft.com/en-us/help/905231/information-about-the-characters-that-you-cannot-use-in-site-names--fo */
"~", "#", "%", "&", "*", "{", "}", "\\", ":", "[", "]", "?", "/", "|", "\'", "\"",
@ -223,6 +227,7 @@ enum input_driver_enum
INPUT_WII,
INPUT_WIIU,
INPUT_XINPUT,
INPUT_UWP,
INPUT_UDEV,
INPUT_LINUXRAW,
INPUT_COCOA,
@ -319,6 +324,13 @@ static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_WII;
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_WIIU;
#elif defined(XENON)
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_XENON360;
#elif defined(HAVE_D3D12) && false
/* FIXME: DX12 performance on Xbox is horrible for some reason, so use d3d11 as default */
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D12;
#elif defined(HAVE_D3D11)
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D11;
#elif defined(HAVE_D3D10)
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D10;
#elif defined(HAVE_D3D9)
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D9;
#elif defined(HAVE_D3D8)
@ -427,7 +439,9 @@ static enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_ALSA;
static enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_NULL;
#endif
#if defined(XENON)
#ifdef __WINRT__
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_UWP;
#elif defined(XENON)
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_XENON360;
#elif defined(_XBOX360) || defined(_XBOX) || defined(HAVE_XINPUT2) || defined(HAVE_XINPUT_XBOX1)
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_XINPUT;
@ -857,6 +871,8 @@ const char *config_get_default_input(void)
return "xenon360";
case INPUT_XINPUT:
return "xinput";
case INPUT_UWP:
return "uwp";
case INPUT_WII:
return "gx";
case INPUT_WIIU:
@ -2221,8 +2237,13 @@ static config_file_t *open_default_config_file(void)
(void)path_size;
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
fill_pathname_application_path(app_path, path_size);
#if defined(_WIN32) && !defined(_XBOX)
#ifdef __WINRT__
/* On UWP, the app install directory is not writable so use the writable LocalState dir instead */
fill_pathname_home_dir(app_path, path_size);
#else
fill_pathname_application_dir(app_path, path_size);
#endif
fill_pathname_resolve_relative(conf_path, app_path,
file_path_str(FILE_PATH_MAIN_CONFIG), path_size);

View File

@ -306,6 +306,7 @@ static void libretro_get_environment_info(void (*func)(retro_environment_t),
static bool load_dynamic_core(void)
{
#ifndef __WINRT__ /* Can't lookup symbols in itself on UWP */
function_t sym = dylib_proc(NULL, "retro_init");
if (sym)
@ -319,6 +320,7 @@ static bool load_dynamic_core(void)
RARCH_ERR("Proceeding could cause a crash. Aborting ...\n");
retroarch_fail(1, "init_libretro_sym()");
}
#endif
if (string_is_empty(path_get(RARCH_PATH_CORE)))
{

View File

@ -43,6 +43,11 @@
#include "../../verbosity.h"
#include "../../ui/drivers/ui_win32.h"
#ifdef __WINRT__
#include "../../uwp/uwp_func.h"
#endif
#ifndef __WINRT__
/* We only load this library once, so we let it be
* unloaded at application shutdown, since unloading
* it early seems to cause issues on some systems.
@ -145,6 +150,7 @@ static void gfx_set_dwm(void)
RARCH_ERR("Failed to set composition state ...\n");
dwm_composition_disabled = settings->bools.video_disable_composition;
}
#endif
static void frontend_win32_get_os(char *s, size_t len, int *major, int *minor)
{
@ -165,7 +171,9 @@ static void frontend_win32_get_os(char *s, size_t len, int *major, int *minor)
GetVersionEx((OSVERSIONINFO*)&vi);
server = vi.wProductType != VER_NT_WORKSTATION;
#ifndef __WINRT__
serverR2 = GetSystemMetrics(SM_SERVERR2);
#endif
switch (si.wProcessorArchitecture)
{
@ -302,10 +310,19 @@ static void frontend_win32_get_os(char *s, size_t len, int *major, int *minor)
strlcat(s, " ", len);
strlcat(s, vi.szCSDVersion, len);
}
#ifdef __WINRT__
if (!string_is_empty(uwp_device_family))
{
strlcat(s, " ", len);
strlcat(s, uwp_device_family, len);
}
#endif
}
static void frontend_win32_init(void *data)
{
#ifndef __WINRT__
typedef BOOL (WINAPI *isProcessDPIAwareProc)();
typedef BOOL (WINAPI *setProcessDPIAwareProc)();
#ifdef HAVE_DYNAMIC
@ -324,6 +341,7 @@ static void frontend_win32_init(void *data)
if (!isDPIAwareProc())
if (setDPIAwareProc)
setDPIAwareProc();
#endif
}
enum frontend_powerstate frontend_win32_get_powerstate(int *seconds, int *percent)
@ -385,13 +403,14 @@ enum frontend_architecture frontend_win32_get_architecture(void)
static int frontend_win32_parse_drive_list(void *data, bool load_content)
{
#ifdef HAVE_MENU
file_list_t *list = (file_list_t*)data;
enum msg_hash_enums enum_idx = load_content ?
MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR :
MSG_UNKNOWN;
#ifndef __WINRT__
size_t i = 0;
unsigned drives = GetLogicalDrives();
char drive[] = " :\\";
file_list_t *list = (file_list_t*)data;
enum msg_hash_enums enum_idx = load_content ?
MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR :
MSG_UNKNOWN;
for (i = 0; i < 32; i++)
{
@ -403,6 +422,22 @@ static int frontend_win32_parse_drive_list(void *data, bool load_content)
enum_idx,
FILE_TYPE_DIRECTORY, 0, 0);
}
#else
/* TODO (krzys_h): UWP storage sandboxing */
char *home_dir = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
fill_pathname_home_dir(home_dir,
PATH_MAX_LENGTH * sizeof(char));
menu_entries_append_enum(list,
home_dir,
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
enum_idx,
FILE_TYPE_DIRECTORY, 0, 0);
free(home_dir);
#endif
#endif
return 0;
@ -411,6 +446,7 @@ static int frontend_win32_parse_drive_list(void *data, bool load_content)
static void frontend_win32_environment_get(int *argc, char *argv[],
void *args, void *params_data)
{
#ifndef __WINRT__
gfx_set_dwm();
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_ASSETS],
@ -459,6 +495,57 @@ static void frontend_win32_environment_get(int *argc, char *argv[],
":\\states", sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_SYSTEM],
":\\system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
#else
/* On UWP, we have to use the writable directory instead of the install directory */
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_ASSETS],
"~\\assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER],
"~\\filters\\audio", sizeof(g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER],
"~\\filters\\video", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_CHEATS],
"~\\cheats", sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_DATABASE],
"~\\database\\rdb", sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_CURSOR],
"~\\database\\cursors", sizeof(g_defaults.dirs[DEFAULT_DIR_CURSOR]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_PLAYLIST],
"~\\playlists", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_RECORD_CONFIG],
"~\\config\\record", sizeof(g_defaults.dirs[DEFAULT_DIR_RECORD_CONFIG]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_RECORD_OUTPUT],
"~\\recordings", sizeof(g_defaults.dirs[DEFAULT_DIR_RECORD_OUTPUT]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_MENU_CONFIG],
"~\\config", sizeof(g_defaults.dirs[DEFAULT_DIR_MENU_CONFIG]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_REMAP],
"~\\config\\remaps", sizeof(g_defaults.dirs[DEFAULT_DIR_REMAP]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_WALLPAPERS],
"~\\assets\\wallpapers", sizeof(g_defaults.dirs[DEFAULT_DIR_WALLPAPERS]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS],
"~\\thumbnails", sizeof(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_OVERLAY],
"~\\overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
/* This one is an exception: cores have to be loaded from the install directory,
* since this is the only place UWP apps can take .dlls from */
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_CORE],
":\\cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_CORE_INFO],
"~\\info", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG],
"~\\autoconfig", sizeof(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_SHADER],
"~\\shaders", sizeof(g_defaults.dirs[DEFAULT_DIR_SHADER]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS],
"~\\downloads", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT],
"~\\screenshots", sizeof(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_SRAM],
"~\\saves", sizeof(g_defaults.dirs[DEFAULT_DIR_SRAM]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_SAVESTATE],
"~\\states", sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]));
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_SYSTEM],
"~\\system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
#endif
#ifdef HAVE_MENU
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
@ -502,6 +589,7 @@ static uint64_t frontend_win32_get_mem_used(void)
#endif
}
#ifndef __WINRT__
static void frontend_win32_attach_console(void)
{
#ifdef _WIN32
@ -560,6 +648,7 @@ static void frontend_win32_detach_console(void)
#endif
#endif
}
#endif
frontend_ctx_driver_t frontend_ctx_win32 = {
frontend_win32_environment_get,
@ -583,8 +672,13 @@ frontend_ctx_driver_t frontend_ctx_win32 = {
NULL, /* get_sighandler_state */
NULL, /* set_sighandler_state */
NULL, /* destroy_sighandler_state */
#ifndef __WINRT__
frontend_win32_attach_console, /* attach_console */
frontend_win32_detach_console, /* detach_console */
#else
NULL,
NULL,
#endif
NULL, /* watch_path_for_changes */
NULL, /* check_for_path_changes */
NULL, /* set_sustained_performance_mode */

View File

@ -20,7 +20,7 @@
#include "d3d10_common.h"
#include "d3dcompiler_common.h"
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#include <dynamic/dylib.h>
typedef HRESULT(WINAPI* PFN_D3D10_CREATE_DEVICE_AND_SWAP_CHAIN)(

View File

@ -20,7 +20,7 @@
#include "d3d11_common.h"
#include "d3dcompiler_common.h"
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#include <dynamic/dylib.h>
HRESULT WINAPI D3D11CreateDeviceAndSwapChain(

View File

@ -2159,6 +2159,7 @@ static INLINE HRESULT D3D11ValidateContextForDispatch(D3D11Debug debug, D3D11Dev
{
return debug->lpVtbl->ValidateContextForDispatch(debug, context);
}
#ifndef __WINRT__
static INLINE BOOL D3D11SetUseRef(D3D11SwitchToRef switch_to_ref, BOOL use_ref)
{
return switch_to_ref->lpVtbl->SetUseRef(switch_to_ref, use_ref);
@ -2167,6 +2168,7 @@ static INLINE BOOL D3D11GetUseRef(D3D11SwitchToRef switch_to_ref)
{
return switch_to_ref->lpVtbl->GetUseRef(switch_to_ref);
}
#endif
static INLINE HRESULT D3D11SetShaderTrackingOptionsByType(
D3D11TracingDevice tracing_device, UINT resource_type_flags, UINT options)
{
@ -2188,6 +2190,7 @@ static INLINE void D3D11ClearStoredMessages(D3D11InfoQueue info_queue)
{
info_queue->lpVtbl->ClearStoredMessages(info_queue);
}
#ifndef __WINRT__
static INLINE HRESULT D3D11GetMessageA(
D3D11InfoQueue info_queue,
UINT64 message_index,
@ -2196,6 +2199,7 @@ static INLINE HRESULT D3D11GetMessageA(
{
return info_queue->lpVtbl->GetMessageA(info_queue, message_index, message, message_byte_length);
}
#endif
static INLINE UINT64 D3D11GetNumMessagesAllowedByStorageFilter(D3D11InfoQueue info_queue)
{
return info_queue->lpVtbl->GetNumMessagesAllowedByStorageFilter(info_queue);

View File

@ -1,4 +1,4 @@
/* RetroArch - A frontend for libretro.
/* RetroArch - A frontend for libretro.
* Copyright (C) 2014-2018 - Ali Bouhlel
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
@ -65,7 +65,7 @@ DEFINE_GUIDW(IID_ID3D12DebugCommandList, 0x09e0bf36, 0x54ac, 0x484f, 0x88, 0x47,
/* clang-format on */
#endif
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
static dylib_t d3d12_dll;
static const char* d3d12_dll_name = "d3d12.dll";
@ -159,15 +159,24 @@ bool d3d12_init_base(d3d12_video_t* d3d12)
D3D12EnableDebugLayer(d3d12->debugController);
#endif
#ifdef __WINRT__
DXGICreateFactory2(&d3d12->factory);
#else
DXGICreateFactory(&d3d12->factory);
#endif
{
int i = 0;
while (true)
{
#ifdef __WINRT__
if (FAILED(DXGIEnumAdapters2(d3d12->factory, i++, &d3d12->adapter)))
return false;
#else
if (FAILED(DXGIEnumAdapters(d3d12->factory, i++, &d3d12->adapter)))
return false;
#endif
if (SUCCEEDED(D3D12CreateDevice_(d3d12->adapter, D3D_FEATURE_LEVEL_11_0, &d3d12->device)))
break;
@ -206,18 +215,33 @@ bool d3d12_init_queue(d3d12_video_t* d3d12)
return true;
}
#ifdef __WINRT__
bool d3d12_init_swapchain(d3d12_video_t* d3d12,
int width, int height, void* corewindow)
#else
bool d3d12_init_swapchain(d3d12_video_t* d3d12,
int width, int height, HWND hwnd)
#endif
{
unsigned i;
#ifdef __WINRT__
DXGI_SWAP_CHAIN_DESC1 desc;
memset(&desc, 0, sizeof(DXGI_SWAP_CHAIN_DESC1));
#else
DXGI_SWAP_CHAIN_DESC desc;
memset(&desc, 0, sizeof(DXGI_SWAP_CHAIN_DESC));
#endif
desc.BufferCount = countof(d3d12->chain.renderTargets);
#ifdef __WINRT__
desc.Width = width;
desc.Height = height;
desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
#else
desc.BufferDesc.Width = width;
desc.BufferDesc.Height = height;
desc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
#endif
desc.SampleDesc.Count = 1;
#if 0
desc.BufferDesc.RefreshRate.Numerator = 60;
@ -225,16 +249,25 @@ bool d3d12_init_swapchain(d3d12_video_t* d3d12,
desc.SampleDesc.Quality = 0;
#endif
desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
#ifdef HAVE_WINDOW
desc.OutputWindow = hwnd;
desc.Windowed = TRUE;
#endif
#if 0
desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
#else
desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
#endif
DXGICreateSwapChain(d3d12->factory, d3d12->queue.handle, &desc, &d3d12->chain.handle);
#ifdef __WINRT__
DXGICreateSwapChainForCoreWindow(d3d12->factory, d3d12->queue.handle, corewindow, &desc, NULL, &d3d12->chain.handle);
#else
DXGICreateSwapChain(d3d12->factory, d3d12->queue.handle, &desc, &d3d12->chain.handle);
#endif
#ifdef HAVE_WINDOW
DXGIMakeWindowAssociation(d3d12->factory, hwnd, DXGI_MWA_NO_ALT_ENTER);
#endif
d3d12->chain.frame_index = DXGIGetCurrentBackBufferIndex(d3d12->chain.handle);

View File

@ -1001,6 +1001,7 @@ static INLINE void D3D12ClearStoredMessages(D3D12InfoQueue info_queue)
{
info_queue->lpVtbl->ClearStoredMessages(info_queue);
}
#ifndef __WINRT__
static INLINE HRESULT D3D12GetMessageA(
D3D12InfoQueue info_queue,
UINT64 message_index,
@ -1009,6 +1010,7 @@ static INLINE HRESULT D3D12GetMessageA(
{
return info_queue->lpVtbl->GetMessageA(info_queue, message_index, message, message_byte_length);
}
#endif
static INLINE UINT64 D3D12GetNumMessagesAllowedByStorageFilter(D3D12InfoQueue info_queue)
{
return info_queue->lpVtbl->GetNumMessagesAllowedByStorageFilter(info_queue);
@ -1341,7 +1343,11 @@ static_assert(
typedef struct
{
unsigned cur_mon_id;
#ifdef __WINRT__
DXGIFactory2 factory;
#else
DXGIFactory factory;
#endif
DXGIAdapter adapter;
D3D12Device device;

View File

@ -125,3 +125,42 @@ int32_t d3d_translate_filter(unsigned type)
return (int32_t)D3D_TEXTURE_FILTER_POINT;
}
void d3d_input_driver(const char* input_name, const char* joypad_name, const input_driver_t** input, void** input_data)
{
#if defined(__WINRT__)
/* Plain xinput is supported on UWP, but it supports joypad only (uwp driver was added later) */
if (string_is_equal(input_name, "xinput"))
{
void *xinput = input_xinput.init(joypad_name);
*input = xinput ? (const input_driver_t*)&input_xinput : NULL;
*input_data = xinput;
}
else
{
void *uwp = input_uwp.init(joypad_name);
*input = uwp ? (const input_driver_t*)&input_uwp : NULL;
*input_data = uwp;
}
#elif defined(_XBOX)
void *xinput = input_xinput.init(joypad_name);
*input = xinput ? (const input_driver_t*)&input_xinput : NULL;
*input_data = xinput;
#else
#if _WIN32_WINNT >= 0x0501
/* winraw only available since XP */
if (string_is_equal(input_name, "raw"))
{
*input_data = input_winraw.init(joypad_name);
if (*input_data)
{
*input = &input_winraw;
return;
}
}
#endif
*input_data = input_dinput.init(joypad_name);
*input = *input_data ? &input_dinput : NULL;
#endif
}

View File

@ -20,7 +20,7 @@
#include "../../config.h"
#endif
#ifndef _XBOX
#if !defined(_XBOX) && !defined(__WINRT__)
#define HAVE_WINDOW
#endif
@ -97,6 +97,8 @@ void *d3d_matrix_rotation_z(void *_pout, float angle);
int32_t d3d_translate_filter(unsigned type);
void d3d_input_driver(const char* input_name, const char* joypad_name, const input_driver_t** input, void** input_data);
RETRO_END_DECLS
#endif

View File

@ -25,7 +25,7 @@
#include "d3dcompiler_common.h"
#include "../../verbosity.h"
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#include <dynamic/dylib.h>
static dylib_t d3dcompiler_dll;

View File

@ -30,7 +30,7 @@
#include "../video_driver.h"
#include "win32_common.h"
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
#include <dynamic/dylib.h>
HRESULT WINAPI CreateDXGIFactory1(REFIID riid, void** ppFactory)
@ -309,6 +309,7 @@ void dxgi_update_title(video_frame_info_t* video_info)
if (settings->bools.video_memory_show)
{
#ifndef __WINRT__
MEMORYSTATUS stat;
char mem[128];
@ -319,6 +320,7 @@ void dxgi_update_title(video_frame_info_t* video_info)
mem, sizeof(mem), " || MEM: %.2f/%.2fMB", stat.dwAvailPhys / (1024.0f * 1024.0f),
stat.dwTotalPhys / (1024.0f * 1024.0f));
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
#endif
}
if (window)
@ -329,32 +331,11 @@ void dxgi_update_title(video_frame_info_t* video_info)
video_driver_get_window_title(title, sizeof(title));
#ifndef __WINRT__
if (title[0])
window->set_title(&main_window, title);
}
}
void dxgi_input_driver(const char* name, const input_driver_t** input, void** input_data)
{
#ifndef __WINRT__
settings_t* settings = config_get_ptr();
#if _WIN32_WINNT >= 0x0501
/* winraw only available since XP */
if (string_is_equal(settings->arrays.input_driver, "raw"))
{
*input_data = input_winraw.init(name);
if (*input_data)
{
*input = &input_winraw;
return;
}
}
#endif
*input_data = input_dinput.init(name);
*input = *input_data ? &input_dinput : NULL;
#endif
}
}
DXGI_FORMAT glslang_format_to_dxgi(glslang_format fmt)

View File

@ -270,6 +270,9 @@ typedef IDXGISurface1* DXGISurface;
typedef IDXGIOutput* DXGIOutput;
typedef IDXGIDevice* DXGIDevice;
typedef IDXGIFactory1* DXGIFactory;
#ifdef __WINRT__
typedef IDXGIFactory2* DXGIFactory2;
#endif
typedef IDXGIAdapter1* DXGIAdapter;
typedef IDXGIDisplayControl* DXGIDisplayControl;
typedef IDXGIOutputDuplication* DXGIOutputDuplication;
@ -414,6 +417,14 @@ static INLINE HRESULT DXGICreateSwapChain(
return factory->lpVtbl->CreateSwapChain(
factory, (IUnknown*)device, desc, (IDXGISwapChain**)swap_chain);
}
#ifdef __WINRT__
static INLINE HRESULT DXGICreateSwapChainForCoreWindow(
DXGIFactory2 factory, void* device, void* corewindow, DXGI_SWAP_CHAIN_DESC1* desc, DXGIOutput restrict_to, DXGISwapChain* swap_chain)
{
return factory->lpVtbl->CreateSwapChainForCoreWindow(
factory, (IUnknown*)device, (IUnknown*)corewindow, desc, restrict_to, (IDXGISwapChain1**)swap_chain);
}
#endif
static INLINE HRESULT
DXGICreateSoftwareAdapter(DXGIFactory factory, HMODULE module, DXGIAdapter* adapter)
{
@ -423,6 +434,12 @@ static INLINE HRESULT DXGIEnumAdapters(DXGIFactory factory, UINT id, DXGIAdapter
{
return factory->lpVtbl->EnumAdapters1(factory, id, adapter);
}
#ifdef __WINRT__
static INLINE HRESULT DXGIEnumAdapters2(DXGIFactory2 factory, UINT id, DXGIAdapter* adapter)
{
return factory->lpVtbl->EnumAdapters1(factory, id, adapter);
}
#endif
static INLINE BOOL DXGIIsCurrent(DXGIFactory factory)
{
return factory->lpVtbl->IsCurrent(factory);
@ -444,6 +461,7 @@ static INLINE HRESULT DXGIGetAdapterDesc1(DXGIAdapter adapter, DXGI_ADAPTER_DESC
{
return adapter->lpVtbl->GetDesc1(adapter, desc);
}
#ifndef __WINRT__
static INLINE ULONG DXGIReleaseDisplayControl(DXGIDisplayControl display_control)
{
return display_control->lpVtbl->Release(display_control);
@ -612,6 +630,7 @@ static INLINE HRESULT DXGICheckPresentDurationSupport(
swap_chain_media, desired_present_duration, closest_smaller_present_duration,
closest_larger_present_duration);
}
#endif
static INLINE ULONG DXGIReleaseSwapChain(DXGISwapChain swap_chain)
{
return swap_chain->lpVtbl->Release(swap_chain);
@ -758,6 +777,12 @@ static INLINE HRESULT DXGICreateFactory(DXGIFactory* factory)
{
return CreateDXGIFactory1(uuidof(IDXGIFactory1), (void**)factory);
}
#ifdef __WINRT__
static INLINE HRESULT DXGICreateFactory2(DXGIFactory2* factory)
{
return CreateDXGIFactory1(uuidof(IDXGIFactory2), (void**)factory);
}
#endif
/* internal */
@ -793,7 +818,6 @@ void dxgi_copy(
void* dst_data);
void dxgi_update_title(video_frame_info_t* video_info);
void dxgi_input_driver(const char* name, const input_driver_t** input, void** input_data);
DXGI_FORMAT glslang_format_to_dxgi(glslang_format fmt);

View File

@ -1,4 +1,4 @@
/* RetroArch - A frontend for libretro.
/* RetroArch - A frontend for libretro.
* Copyright (C) 2014-2018 - Ali Bouhlel
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
@ -35,6 +35,10 @@
#include "../../menu/menu_driver.h"
#endif
#ifdef __WINRT__
#error "UWP does not support D3D10"
#endif
#ifdef HAVE_OVERLAY
static void d3d10_free_overlays(d3d10_video_t* d3d10)
{
@ -556,8 +560,12 @@ static void d3d10_gfx_free(void* data)
Release(d3d10->device);
}
#ifdef HAVE_MONITOR
win32_monitor_from_window();
#endif
#ifdef HAVE_WINDOW
win32_destroy_window();
#endif
free(d3d10);
}
@ -566,31 +574,39 @@ d3d10_gfx_init(const video_info_t* video,
const input_driver_t** input, void** input_data)
{
unsigned i;
#ifdef HAVE_MONITOR
MONITORINFOEX current_mon;
HMONITOR hm_to_use;
WNDCLASSEX wndclass = { 0 };
#endif
settings_t* settings = config_get_ptr();
d3d10_video_t* d3d10 = (d3d10_video_t*)calloc(1, sizeof(*d3d10));
if (!d3d10)
return NULL;
#ifdef HAVE_WINDOW
win32_window_reset();
win32_monitor_init();
wndclass.lpfnWndProc = WndProcD3D;
win32_window_init(&wndclass, true, NULL);
#endif
#ifdef HAVE_MONITOR
win32_monitor_info(&current_mon, &hm_to_use, &d3d10->cur_mon_id);
#endif
d3d10->vp.full_width = video->width;
d3d10->vp.full_height = video->height;
#ifdef HAVE_MONITOR
if (!d3d10->vp.full_width)
d3d10->vp.full_width =
current_mon.rcMonitor.right - current_mon.rcMonitor.left;
if (!d3d10->vp.full_height)
d3d10->vp.full_height =
current_mon.rcMonitor.bottom - current_mon.rcMonitor.top;
#endif
if (!win32_set_video_mode(d3d10,
d3d10->vp.full_width, d3d10->vp.full_height, video->fullscreen))
@ -598,7 +614,7 @@ d3d10_gfx_init(const video_info_t* video,
RARCH_ERR("[D3D10]: win32_set_video_mode failed.\n");
goto error;
}
dxgi_input_driver(settings->arrays.input_joypad_driver, input, input_data);
d3d_input_driver(settings->arrays.input_driver, settings->arrays.input_joypad_driver, input, input_data);
{
UINT flags = 0;
@ -611,7 +627,9 @@ d3d10_gfx_init(const video_info_t* video,
desc.BufferDesc.RefreshRate.Numerator = 60;
desc.BufferDesc.RefreshRate.Denominator = 1;
desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
#if HAVE_WINDOW
desc.OutputWindow = main_window.hwnd;
#endif
desc.SampleDesc.Count = 1;
desc.SampleDesc.Quality = 0;
desc.Windowed = TRUE;
@ -1598,7 +1616,12 @@ static const video_poke_interface_t d3d10_poke_interface = {
d3d10_gfx_load_texture,
d3d10_gfx_unload_texture,
NULL, /* set_video_mode */
#ifndef __WINRT__
win32_get_refresh_rate,
#else
/* UWP does not expose this information easily */
NULL,
#endif
d3d10_set_filtering,
NULL, /* get_video_output_size */
NULL, /* get_video_output_prev */

View File

@ -1,4 +1,4 @@
/* RetroArch - A frontend for libretro.
/* RetroArch - A frontend for libretro.
* Copyright (C) 2014-2018 - Ali Bouhlel
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
@ -41,6 +41,10 @@
#include "../drivers_shader/slang_process.h"
#endif
#ifdef __WINRT__
#include "../../uwp/uwp_func.h"
#endif
static D3D11Device cached_device_d3d11;
static D3D_FEATURE_LEVEL cached_supportedFeatureLevel;
static D3D11DeviceContext cached_context;
@ -566,8 +570,12 @@ static void d3d11_gfx_free(void* data)
Release(d3d11->device);
}
#ifdef HAVE_MONITOR
win32_monitor_from_window();
#endif
#ifdef HAVE_WINDOW
win32_destroy_window();
#endif
free(d3d11);
}
@ -575,29 +583,37 @@ static void d3d11_gfx_free(void* data)
d3d11_gfx_init(const video_info_t* video, const input_driver_t** input, void** input_data)
{
unsigned i;
#ifdef HAVE_MONITOR
MONITORINFOEX current_mon;
HMONITOR hm_to_use;
WNDCLASSEX wndclass = { 0 };
#endif
settings_t* settings = config_get_ptr();
d3d11_video_t* d3d11 = (d3d11_video_t*)calloc(1, sizeof(*d3d11));
if (!d3d11)
return NULL;
#ifdef HAVE_WINDOW
win32_window_reset();
win32_monitor_init();
wndclass.lpfnWndProc = WndProcD3D;
win32_window_init(&wndclass, true, NULL);
#endif
#ifdef HAVE_MONITOR
win32_monitor_info(&current_mon, &hm_to_use, &d3d11->cur_mon_id);
#endif
d3d11->vp.full_width = video->width;
d3d11->vp.full_height = video->height;
#ifdef HAVE_MONITOR
if (!d3d11->vp.full_width)
d3d11->vp.full_width = current_mon.rcMonitor.right - current_mon.rcMonitor.left;
if (!d3d11->vp.full_height)
d3d11->vp.full_height = current_mon.rcMonitor.bottom - current_mon.rcMonitor.top;
#endif
if (!win32_set_video_mode(d3d11, d3d11->vp.full_width, d3d11->vp.full_height, video->fullscreen))
{
@ -605,7 +621,7 @@ d3d11_gfx_init(const video_info_t* video, const input_driver_t** input, void** i
goto error;
}
dxgi_input_driver(settings->arrays.input_joypad_driver, input, input_data);
d3d_input_driver(settings->arrays.input_driver, settings->arrays.input_joypad_driver, input, input_data);
{
UINT flags = 0;
@ -617,26 +633,45 @@ d3d11_gfx_init(const video_info_t* video, const input_driver_t** input, void** i
D3D_FEATURE_LEVEL_10_0,
D3D_FEATURE_LEVEL_9_3
};
#ifdef __WINRT__
/* UWP requires the use of newer version of the factory which requires newer version of this struct */
DXGI_SWAP_CHAIN_DESC1 desc = { 0 };
#else
DXGI_SWAP_CHAIN_DESC desc = { 0 };
#endif
UINT number_feature_levels = ARRAY_SIZE(requested_feature_levels);
desc.BufferCount = 1;
#ifdef __WINRT__
/* UWP forces us to do double-buffering */
desc.BufferCount = 2;
desc.Width = d3d11->vp.full_width;
desc.Height = d3d11->vp.full_height;
desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
#else
desc.BufferCount = 1;
desc.BufferDesc.Width = d3d11->vp.full_width;
desc.BufferDesc.Height = d3d11->vp.full_height;
desc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
desc.BufferDesc.RefreshRate.Numerator = 60;
desc.BufferDesc.RefreshRate.Denominator = 1;
#endif
desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
#if HAVE_WINDOW
desc.OutputWindow = main_window.hwnd;
#endif
desc.SampleDesc.Count = 1;
desc.SampleDesc.Quality = 0;
#if 0
desc.Scaling = DXGI_SCALING_STRETCH;
#endif
#if HAVE_WINDOW
desc.Windowed = TRUE;
#endif
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
/* On phone, no swap effects are supported. */
desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
#elif defined(__WINRT__)
desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
#else
desc.SwapEffect = DXGI_SWAP_EFFECT_SEQUENTIAL;
#endif
@ -646,37 +681,47 @@ d3d11_gfx_init(const video_info_t* video, const input_driver_t** input, void** i
#endif
if(cached_device_d3d11 && cached_context)
{
IDXGIFactory* dxgiFactory = NULL;
IDXGIDevice* dxgiDevice = NULL;
IDXGIAdapter* adapter = NULL;
d3d11->device = cached_device_d3d11;
d3d11->context = cached_context;
d3d11->supportedFeatureLevel = cached_supportedFeatureLevel;
d3d11->device->lpVtbl->QueryInterface(
d3d11->device, uuidof(IDXGIDevice), (void**)&dxgiDevice);
dxgiDevice->lpVtbl->GetAdapter(dxgiDevice, &adapter);
adapter->lpVtbl->GetParent(
adapter, uuidof(IDXGIFactory1), (void**)&dxgiFactory);
dxgiFactory->lpVtbl->CreateSwapChain(
dxgiFactory, (IUnknown*)d3d11->device,
&desc, (IDXGISwapChain**)&d3d11->swapChain);
dxgiFactory->lpVtbl->Release(dxgiFactory);
adapter->lpVtbl->Release(adapter);
dxgiDevice->lpVtbl->Release(dxgiDevice);
}
else
{
if (FAILED(D3D11CreateDeviceAndSwapChain(
if (FAILED(D3D11CreateDevice(
NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, flags,
requested_feature_levels, number_feature_levels,
D3D11_SDK_VERSION, &desc,
(IDXGISwapChain**)&d3d11->swapChain, &d3d11->device,
D3D11_SDK_VERSION, &d3d11->device,
&d3d11->supportedFeatureLevel, &d3d11->context)))
goto error;
}
IDXGIDevice* dxgiDevice = NULL;
IDXGIAdapter* adapter = NULL;
d3d11->device->lpVtbl->QueryInterface(
d3d11->device, uuidof(IDXGIDevice), (void**)&dxgiDevice);
dxgiDevice->lpVtbl->GetAdapter(dxgiDevice, &adapter);
#ifndef __WINRT__
IDXGIFactory* dxgiFactory = NULL;
adapter->lpVtbl->GetParent(
adapter, uuidof(IDXGIFactory1), (void**)&dxgiFactory);
if (FAILED(dxgiFactory->lpVtbl->CreateSwapChain(
dxgiFactory, (IUnknown*)d3d11->device,
&desc, (IDXGISwapChain**)&d3d11->swapChain)))
goto error;
#else
IDXGIFactory2* dxgiFactory = NULL;
adapter->lpVtbl->GetParent(
adapter, uuidof(IDXGIFactory2), (void**)&dxgiFactory);
if (FAILED(dxgiFactory->lpVtbl->CreateSwapChainForCoreWindow(
dxgiFactory, (IUnknown*)d3d11->device, uwp_get_corewindow(),
&desc, NULL, (IDXGISwapChain1**)&d3d11->swapChain)))
goto error;
#endif
dxgiFactory->lpVtbl->Release(dxgiFactory);
adapter->lpVtbl->Release(adapter);
dxgiDevice->lpVtbl->Release(dxgiDevice);
}
{
@ -1142,6 +1187,11 @@ static bool d3d11_gfx_frame(
video_driver_set_size(&video_info->width, &video_info->height);
}
#ifdef __WINRT__
/* UWP requires double-buffering, so make sure we bind to the appropariate backbuffer */
D3D11SetRenderTargets(context, 1, &d3d11->renderTargetView, NULL);
#endif
PERF_START();
#if 0 /* custom viewport doesn't call apply_state_changes, so we can't rely on this for now */
@ -1622,7 +1672,12 @@ static const video_poke_interface_t d3d11_poke_interface = {
d3d11_gfx_load_texture,
d3d11_gfx_unload_texture,
NULL, /* set_video_mode */
#ifndef __WINRT__
win32_get_refresh_rate,
#else
/* UWP does not expose this information easily */
NULL,
#endif
d3d11_set_filtering,
NULL, /* get_video_output_size */
NULL, /* get_video_output_prev */

View File

@ -1,4 +1,4 @@
/* RetroArch - A frontend for libretro.
/* RetroArch - A frontend for libretro.
* Copyright (C) 2014-2018 - Ali Bouhlel
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
@ -864,8 +864,12 @@ static void d3d12_gfx_free(void* data)
Release(d3d12->device);
Release(d3d12->adapter);
#ifdef HAVE_MONITOR
win32_monitor_from_window();
#endif
#ifdef HAVE_WINDOW
win32_destroy_window();
#endif
free(d3d12);
}
@ -873,29 +877,37 @@ static void d3d12_gfx_free(void* data)
static void*
d3d12_gfx_init(const video_info_t* video, const input_driver_t** input, void** input_data)
{
#ifdef HAVE_MONITOR
MONITORINFOEX current_mon;
HMONITOR hm_to_use;
WNDCLASSEX wndclass = { 0 };
#endif
settings_t* settings = config_get_ptr();
d3d12_video_t* d3d12 = (d3d12_video_t*)calloc(1, sizeof(*d3d12));
if (!d3d12)
return NULL;
#ifdef HAVE_WINDOW
win32_window_reset();
win32_monitor_init();
wndclass.lpfnWndProc = WndProcD3D;
win32_window_init(&wndclass, true, NULL);
#endif
#ifdef HAVE_MONITOR
win32_monitor_info(&current_mon, &hm_to_use, &d3d12->cur_mon_id);
#endif
d3d12->vp.full_width = video->width;
d3d12->vp.full_height = video->height;
#ifdef HAVE_MONITOR
if (!d3d12->vp.full_width)
d3d12->vp.full_width = current_mon.rcMonitor.right - current_mon.rcMonitor.left;
if (!d3d12->vp.full_height)
d3d12->vp.full_height = current_mon.rcMonitor.bottom - current_mon.rcMonitor.top;
#endif
if (!win32_set_video_mode(d3d12, d3d12->vp.full_width, d3d12->vp.full_height, video->fullscreen))
{
@ -903,7 +915,7 @@ d3d12_gfx_init(const video_info_t* video, const input_driver_t** input, void** i
goto error;
}
dxgi_input_driver(settings->arrays.input_joypad_driver, input, input_data);
d3d_input_driver(settings->arrays.input_driver, settings->arrays.input_joypad_driver, input, input_data);
if (!d3d12_init_base(d3d12))
goto error;
@ -917,8 +929,13 @@ d3d12_gfx_init(const video_info_t* video, const input_driver_t** input, void** i
if (!d3d12_init_queue(d3d12))
goto error;
#ifdef __WINRT__
if (!d3d12_init_swapchain(d3d12, d3d12->vp.full_width, d3d12->vp.full_height, uwp_get_corewindow()))
goto error;
#else
if (!d3d12_init_swapchain(d3d12, d3d12->vp.full_width, d3d12->vp.full_height, main_window.hwnd))
goto error;
#endif
d3d12_init_samplers(d3d12);
d3d12_set_filtering(d3d12, 0, video->smooth);
@ -1764,7 +1781,12 @@ static const video_poke_interface_t d3d12_poke_interface = {
d3d12_gfx_load_texture,
d3d12_gfx_unload_texture,
NULL, /* set_video_mode */
#ifndef __WINRT__
win32_get_refresh_rate,
#else
/* UWP does not expose this information easily */
NULL,
#endif
d3d12_set_filtering,
NULL, /* get_video_output_size */
NULL, /* get_video_output_prev */

View File

@ -48,9 +48,11 @@
#ifdef _XBOX
#define D3D8_PRESENTATIONINTERVAL D3DRS_PRESENTATIONINTERVAL
#else
#ifndef __WINRT__
#define HAVE_MONITOR
#define HAVE_WINDOW
#endif
#endif
#ifdef HAVE_MENU
#include "../../menu/menu_driver.h"
@ -61,6 +63,10 @@
#include "../../core.h"
#include "../../verbosity.h"
#ifdef __WINRT__
#error "UWP does not support D3D8"
#endif
static LPDIRECT3D8 g_pD3D8;
#ifdef _XBOX
@ -1137,37 +1143,6 @@ static void d3d8_set_osd_msg(void *data,
d3d8_end_scene(d3d->dev);
}
static void d3d8_input_driver(
const input_driver_t **input, void **input_data)
{
settings_t *settings = config_get_ptr();
const char *name = settings ?
settings->arrays.input_joypad_driver : NULL;
#ifdef _XBOX
void *xinput = input_xinput.init(name);
*input = xinput ? (const input_driver_t*)&input_xinput : NULL;
*input_data = xinput;
#else
#if _WIN32_WINNT >= 0x0501
/* winraw only available since XP */
if (string_is_equal(settings->arrays.input_driver, "raw"))
{
*input_data = input_winraw.init(name);
if (*input_data)
{
*input = &input_winraw;
dinput = NULL;
return;
}
}
#endif
dinput = input_dinput.init(name);
*input = dinput ? &input_dinput : NULL;
*input_data = dinput;
#endif
}
static bool d3d8_init_internal(d3d8_video_t *d3d,
const video_info_t *info, const input_driver_t **input,
void **input_data)
@ -1255,7 +1230,7 @@ static bool d3d8_init_internal(d3d8_video_t *d3d,
if (!d3d8_initialize(d3d, &d3d->video_info))
return false;
d3d8_input_driver(input, input_data);
d3d_input_driver(settings->arrays.input_driver, settings->arrays.input_joypad_driver, input, input_data);
RARCH_LOG("[D3D8]: Init complete.\n");
return true;
@ -1888,9 +1863,10 @@ static const video_poke_interface_t d3d_poke_interface = {
d3d8_load_texture,
d3d8_unload_texture,
d3d8_set_video_mode,
#ifdef _XBOX
#if defined(_XBOX) || defined(__WINRT__)
NULL,
#else
/* UWP does not expose this information easily */
win32_get_refresh_rate,
#endif
NULL,

View File

@ -1,4 +1,4 @@
/* RetroArch - A frontend for libretro.
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2017 - Daniel De Matteis
* Copyright (C) 2012-2014 - OV2
@ -65,6 +65,10 @@
#include "../../verbosity.h"
#include "../../retroarch.h"
#ifdef __WINRT__
#error "UWP does not support D3D9"
#endif
static LPDIRECT3D9 g_pD3D9;
void *dinput;
@ -1182,38 +1186,6 @@ static void d3d9_set_osd_msg(void *data,
d3d9_end_scene(dev);
}
static void d3d9_input_driver(
const input_driver_t **input, void **input_data)
{
settings_t *settings = config_get_ptr();
const char *name = settings ?
settings->arrays.input_joypad_driver : NULL;
#ifdef _XBOX
void *xinput = input_xinput.init(name);
*input = xinput ? (const input_driver_t*)&input_xinput : NULL;
*input_data = xinput;
#else
#if _WIN32_WINNT >= 0x0501
/* winraw only available since XP */
if (string_is_equal(settings->arrays.input_driver, "raw"))
{
*input_data = input_winraw.init(name);
if (*input_data)
{
*input = &input_winraw;
dinput = NULL;
return;
}
}
#endif
dinput = input_dinput.init(name);
*input = dinput ? &input_dinput : NULL;
*input_data = dinput;
#endif
}
static bool d3d9_init_internal(d3d9_video_t *d3d,
const video_info_t *info, const input_driver_t **input,
void **input_data)
@ -1325,7 +1297,7 @@ static bool d3d9_init_internal(d3d9_video_t *d3d,
if (!d3d9_initialize(d3d, &d3d->video_info))
return false;
d3d9_input_driver(input, input_data);
d3d_input_driver(settings->arrays.input_joypad_driver, input, input_data);
RARCH_LOG("[D3D9]: Init complete.\n");
return true;
@ -2054,9 +2026,10 @@ static const video_poke_interface_t d3d9_poke_interface = {
d3d9_load_texture,
d3d9_unload_texture,
d3d9_set_video_mode,
#ifdef _XBOX
#if defined(_XBOX) || defined(__WINRT__)
NULL,
#else
/* UWP does not expose this information easily */
win32_get_refresh_rate,
#endif
NULL,

View File

@ -278,7 +278,7 @@ static bool vga_font_init_first(
}
#endif
#if defined(_WIN32) && !defined(_XBOX)
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
static const font_renderer_t *gdi_font_backends[] = {
&gdi_font,
NULL,
@ -666,7 +666,7 @@ static bool font_init_first(
return switch_font_init_first(font_driver, font_handle,
video_data, font_path, font_size, is_threaded);
#endif
#if defined(_WIN32) && !defined(_XBOX)
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
case FONT_DRIVER_RENDER_GDI:
return gdi_font_init_first(font_driver, font_handle,
video_data, font_path, font_size, is_threaded);

View File

@ -39,7 +39,7 @@ void* video_display_server_init(void)
switch (type)
{
case RARCH_DISPLAY_WIN32:
#if defined(_WIN32) && !defined(_XBOX)
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
current_display_server = &dispserv_win32;
#endif
break;

View File

@ -274,14 +274,14 @@ static const video_driver_t *video_drivers[] = {
#ifdef XENON
&video_xenon360,
#endif
#if defined(HAVE_D3D10)
&video_d3d10,
#if defined(HAVE_D3D12)
&video_d3d12,
#endif
#if defined(HAVE_D3D11)
&video_d3d11,
#endif
#if defined(HAVE_D3D12)
&video_d3d12,
#if defined(HAVE_D3D10)
&video_d3d10,
#endif
#if defined(HAVE_D3D9)
&video_d3d9,
@ -340,7 +340,7 @@ static const video_driver_t *video_drivers[] = {
#ifdef HAVE_XSHM
&video_xshm,
#endif
#if defined(_WIN32) && !defined(_XBOX)
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
&video_gdi,
#endif
#ifdef DJGPP
@ -416,7 +416,7 @@ static const gfx_ctx_driver_t *gfx_ctx_drivers[] = {
#if defined(HAVE_VULKAN) && defined(HAVE_VULKAN_DISPLAY)
&gfx_ctx_khr_display,
#endif
#if defined(_WIN32) && !defined(_XBOX)
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
&gfx_ctx_gdi,
#endif
#ifdef HAVE_SIXEL

View File

@ -601,6 +601,9 @@ INPUT
#elif defined(DJGPP)
#include "../input/drivers/dos_input.c"
#include "../input/drivers_joypad/dos_joypad.c"
#elif defined(__WINRT__)
#include "../input/drivers/xdk_xinput_input.c"
#include "../input/drivers/uwp_input.c"
#endif
#ifdef HAVE_WAYLAND
@ -947,7 +950,7 @@ FRONTEND
#include "../frontend/frontend_driver.c"
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
#if defined(_WIN32) && !defined(_XBOX)
#include "../frontend/drivers/platform_win32.c"
#endif
@ -1259,7 +1262,7 @@ MENU
#include "../menu/drivers_display/menu_display_vga.c"
#endif
#if defined(_WIN32) && !defined(_XBOX)
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
#include "../menu/drivers_display/menu_display_gdi.c"
#endif

174
input/drivers/uwp_input.c Normal file
View File

@ -0,0 +1,174 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2018 - Krzysztof Haładyn
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <stdlib.h>
#ifdef HAVE_CONFIG_H
#include "../../config.h"
#endif
#include <boolean.h>
#include <libretro.h>
#include <uwp/uwp_func.h>
#include "../input_driver.h"
// TODO: Add support for multiple mice and multiple touch
typedef struct uwp_input
{
bool blocked;
const input_device_driver_t *joypad;
} uwp_input_t;
static void uwp_input_poll(void *data)
{
uwp_input_t *uwp = (uwp_input_t*)data;
if (uwp && uwp->joypad)
uwp->joypad->poll();
uwp_input_next_frame();
}
static int16_t uwp_input_state(void *data,
rarch_joypad_info_t joypad_info,
const struct retro_keybind **binds,
unsigned port, unsigned device,
unsigned index, unsigned id)
{
uwp_input_t *uwp = (uwp_input_t*)data;
switch (device)
{
case RETRO_DEVICE_JOYPAD:
return input_joypad_pressed(uwp->joypad, joypad_info, port, binds[port], id);
case RETRO_DEVICE_ANALOG:
if (binds[port])
return input_joypad_analog(uwp->joypad, joypad_info, port, index, id, binds[port]);
break;
case RETRO_DEVICE_KEYBOARD:
return (id < RETROK_LAST) && uwp_keyboard_pressed(id);
case RETRO_DEVICE_MOUSE:
case RARCH_DEVICE_MOUSE_SCREEN:
return uwp_mouse_state(port, id, device == RARCH_DEVICE_MOUSE_SCREEN);
case RETRO_DEVICE_POINTER:
case RARCH_DEVICE_POINTER_SCREEN:
return uwp_pointer_state(index, id, device == RARCH_DEVICE_POINTER_SCREEN);
}
return 0;
}
static void uwp_input_free_input(void *data)
{
uwp_input_t *uwp = (uwp_input_t*)data;
if (!uwp)
return;
if (uwp->joypad)
uwp->joypad->destroy();
free(uwp);
}
static void *uwp_input_init(const char *joypad_driver)
{
uwp_input_t *uwp = (uwp_input_t*)calloc(1, sizeof(*uwp));
if (!uwp)
return NULL;
input_keymaps_init_keyboard_lut(rarch_key_map_uwp);
uwp->joypad = input_joypad_init_driver(joypad_driver, uwp);
return uwp;
}
static uint64_t uwp_input_get_capabilities(void *data)
{
uint64_t caps = 0;
caps |= (1 << RETRO_DEVICE_JOYPAD);
caps |= (1 << RETRO_DEVICE_MOUSE);
caps |= (1 << RETRO_DEVICE_KEYBOARD);
caps |= (1 << RETRO_DEVICE_POINTER);
caps |= (1 << RETRO_DEVICE_ANALOG);
return caps;
}
static bool uwp_input_set_rumble(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
struct uwp_input *uwp = (struct uwp_input*)data;
if (!uwp)
return false;
return input_joypad_set_rumble(uwp->joypad, port, effect, strength);
}
static const input_device_driver_t *uwp_input_get_joypad_driver(void *data)
{
uwp_input_t *uwp = (uwp_input_t*)data;
if (!uwp)
return NULL;
return uwp->joypad;
}
static void uwp_input_grab_mouse(void *data, bool state)
{
(void)data;
(void)state;
}
static bool uwp_keyboard_mapping_is_blocked(void *data)
{
uwp_input_t *uwp = (uwp_input_t*)data;
if (!uwp)
return false;
return uwp->blocked;
}
static void uwp_keyboard_mapping_set_block(void *data, bool value)
{
uwp_input_t *uwp = (uwp_input_t*)data;
if (!uwp)
return;
uwp->blocked = value;
}
input_driver_t input_uwp = {
uwp_input_init,
uwp_input_poll,
uwp_input_state,
uwp_input_free_input,
NULL,
NULL,
uwp_input_get_capabilities,
"uwp",
uwp_input_grab_mouse,
NULL,
uwp_input_set_rumble,
uwp_input_get_joypad_driver,
NULL,
uwp_keyboard_mapping_is_blocked,
uwp_keyboard_mapping_set_block,
};

View File

@ -42,12 +42,20 @@
#ifdef HAVE_DINPUT
#include "dinput_joypad.h"
#else
int g_xinput_pad_indexes[MAX_USERS];
bool g_xinput_block_pads;
#endif
#if defined(__WINRT__)
#include <Xinput.h>
#endif
/* Check if the definitions do not already exist.
* Official and mingw xinput headers have different include guards.
* Windows 10 API version doesn't have an include guard at all and just uses #pragma once instead
*/
#if ((!_XINPUT_H_) && (!__WINE_XINPUT_H))
#if ((!_XINPUT_H_) && (!__WINE_XINPUT_H)) && !defined(__WINRT__)
#define XINPUT_GAMEPAD_DPAD_UP 0x0001
#define XINPUT_GAMEPAD_DPAD_DOWN 0x0002
@ -173,7 +181,7 @@ const char *xinput_joypad_name(unsigned pad)
return XBOX_CONTROLLER_NAMES[xuser];
}
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
static bool load_xinput_dll(void)
{
const char *version = "1.4";
@ -210,7 +218,7 @@ static bool xinput_joypad_init(void *data)
unsigned i, j;
XINPUT_STATE dummy_state;
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
if (!g_xinput_dll)
if (!load_xinput_dll())
return false;
@ -219,6 +227,9 @@ static bool xinput_joypad_init(void *data)
* First try to load ordinal 100 (XInputGetStateEx).
*/
g_XInputGetStateEx = (XInputGetStateEx_t)dylib_proc(g_xinput_dll, (const char*)100);
#elif defined(__WINRT__)
/* XInputGetStateEx is not available on WinRT */
g_XInputGetStateEx = NULL;
#else
g_XInputGetStateEx = (XInputGetStateEx_t)XInputGetStateEx;
#endif
@ -230,7 +241,7 @@ static bool xinput_joypad_init(void *data)
* XInputGetState, at the cost of losing guide button support.
*/
g_xinput_guide_button_supported = false;
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
g_XInputGetStateEx = (XInputGetStateEx_t)dylib_proc(g_xinput_dll, "XInputGetState");
#else
g_XInputGetStateEx = (XInputGetStateEx_t)XInputGetState;
@ -239,7 +250,7 @@ static bool xinput_joypad_init(void *data)
if (!g_XInputGetStateEx)
{
RARCH_ERR("[XInput]: Failed to init: DLL is invalid or corrupt.\n");
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
dylib_close(g_xinput_dll);
#endif
return false; /* DLL was loaded but did not contain the correct function. */
@ -247,7 +258,7 @@ static bool xinput_joypad_init(void *data)
RARCH_WARN("[XInput]: No guide button support.\n");
}
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
g_XInputSetState = (XInputSetState_t)dylib_proc(g_xinput_dll, "XInputSetState");
#else
g_XInputSetState = (XInputSetState_t)XInputSetState;
@ -255,7 +266,7 @@ static bool xinput_joypad_init(void *data)
if (!g_XInputSetState)
{
RARCH_ERR("[XInput]: Failed to init: DLL is invalid or corrupt.\n");
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
dylib_close(g_xinput_dll);
#endif
return false; /* DLL was loaded but did not contain the correct function. */
@ -277,7 +288,7 @@ static bool xinput_joypad_init(void *data)
(!g_xinput_states[1].connected) &&
(!g_xinput_states[2].connected) &&
(!g_xinput_states[3].connected))
return false;
return true;
RARCH_LOG("[XInput]: Pads connected: %d\n", g_xinput_states[0].connected +
g_xinput_states[1].connected + g_xinput_states[2].connected + g_xinput_states[3].connected);
@ -347,7 +358,7 @@ static void xinput_joypad_destroy(void)
for (i = 0; i < 4; ++i)
memset(&g_xinput_states[i], 0, sizeof(xinput_joypad_state));
#ifdef HAVE_DYNAMIC
#if defined(HAVE_DYNAMIC) && !defined(__WINRT__)
dylib_close(g_xinput_dll);
g_xinput_dll = NULL;
@ -499,6 +510,7 @@ static void xinput_joypad_poll(void)
for (i = 0; i < 4; ++i)
{
#ifdef HAVE_DINPUT
if (g_xinput_states[i].connected)
{
if (g_XInputGetStateEx && g_XInputGetStateEx(i,
@ -506,6 +518,28 @@ static void xinput_joypad_poll(void)
== ERROR_DEVICE_NOT_CONNECTED)
g_xinput_states[i].connected = false;
}
#else
/* Normally, dinput handles device insertion/removal for us, but
* since dinput is not available on UWP we have to do it ourselves */
/* Also note that on UWP, the controllers are not available on startup
* and are instead 'plugged in' a moment later because Microsoft reasons */
// TODO: This may be bad for performance?
bool new_connected = g_XInputGetStateEx && g_XInputGetStateEx(i, &(g_xinput_states[i].xstate)) != ERROR_DEVICE_NOT_CONNECTED;
if (new_connected != g_xinput_states[i].connected)
{
if (new_connected)
{
/* This is kinda ugly, but it's the same thing that dinput does */
xinput_joypad_destroy();
xinput_joypad_init(NULL);
return;
}
else
{
g_xinput_states[i].connected = new_connected;
}
}
#endif
}
#ifdef HAVE_DINPUT

View File

@ -104,10 +104,13 @@ static const input_driver_t *input_drivers[] = {
#ifdef HAVE_X11
&input_x,
#endif
#ifdef __WINRT__
&input_uwp,
#endif
#ifdef XENON
&input_xenon360,
#endif
#if defined(HAVE_XINPUT2) || defined(HAVE_XINPUT_XBOX1)
#if defined(HAVE_XINPUT2) || defined(HAVE_XINPUT_XBOX1) || defined(__WINRT__)
&input_xinput,
#endif
#ifdef GEKKO
@ -137,7 +140,7 @@ static const input_driver_t *input_drivers[] = {
#ifdef DJGPP
&input_dos,
#endif
#if defined(_WIN32) && !defined(_XBOX) && _WIN32_WINNT >= 0x0501
#if defined(_WIN32) && !defined(_XBOX) && _WIN32_WINNT >= 0x0501 && !defined(__WINRT__)
/* winraw only available since XP */
&input_winraw,
#endif

View File

@ -834,6 +834,7 @@ extern input_driver_t input_xenon360;
extern input_driver_t input_gx;
extern input_driver_t input_wiiu;
extern input_driver_t input_xinput;
extern input_driver_t input_uwp;
extern input_driver_t input_linuxraw;
extern input_driver_t input_udev;
extern input_driver_t input_cocoa;

View File

@ -1423,7 +1423,7 @@ const struct rarch_key_map rarch_key_map_dos[] = {
};
#endif
#if defined(_WIN32) && _WIN32_WINNT >= 0x0501
#if defined(_WIN32) && _WIN32_WINNT >= 0x0501 && !defined(__WINRT__)
const struct rarch_key_map rarch_key_map_winraw[] = {
{ VK_BACK, RETROK_BACKSPACE },
{ VK_TAB, RETROK_TAB },
@ -1539,6 +1539,11 @@ const struct rarch_key_map rarch_key_map_winraw[] = {
};
#endif
#ifdef __WINRT__
/* Refer to uwp_main.cpp - on WinRT these constants are defined as C++ enum classes
* so they can't be placed in a C source file */
#endif
enum retro_key rarch_keysym_lut[RETROK_LAST];
/**

View File

@ -74,17 +74,42 @@ static void set_dl_error(void)
dylib_t dylib_load(const char *path)
{
#ifdef _WIN32
#ifndef __WINRT__
int prevmode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
#ifdef LEGACY_WIN32
#endif
#ifdef __WINRT__
/* On UWP, you can only load DLLs inside your install directory, using a special function that takes a relative path */
if (!path_is_absolute(path))
RARCH_WARN("Relative path in dylib_load! This is likely an attempt to load a system library that will fail\n");
char *relative_path_abbrev = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
fill_pathname_abbreviate_special(relative_path_abbrev, path, PATH_MAX_LENGTH * sizeof(char));
char *relative_path = relative_path_abbrev;
if (relative_path[0] != ':' || !path_char_is_slash(relative_path[1]))
RARCH_WARN("Path to dylib_load is not inside app install directory! Loading will probably fail\n");
else
relative_path += 2;
RARCH_LOG("Loading library using a relative path: '%s'\n", relative_path);
wchar_t *pathW = utf8_to_utf16_string_alloc(relative_path);
dylib_t lib = LoadPackagedLibrary(pathW, 0);
free(pathW);
free(relative_path_abbrev);
#elif defined(LEGACY_WIN32)
dylib_t lib = LoadLibrary(path);
#else
wchar_t *pathW = utf8_to_utf16_string_alloc(path);
dylib_t lib = LoadLibraryW(pathW);
free(pathW);
#endif
#ifndef __WINRT__
SetErrorMode(prevmode);
#endif
if (!lib)
{
@ -114,8 +139,20 @@ function_t dylib_proc(dylib_t lib, const char *proc)
function_t sym;
#ifdef _WIN32
sym = (function_t)GetProcAddress(lib ?
(HMODULE)lib : GetModuleHandle(NULL), proc);
HMODULE mod = (HMODULE)lib;
#ifndef __WINRT__
if (!mod)
mod = GetModuleHandle(NULL);
#else
/* GetModuleHandle is not available on UWP */
if (!mod)
{
RARCH_WARN("FIXME: It's not possible to look up symbols in current executable on UWP!\n");
DebugBreak();
return NULL;
}
#endif
sym = (function_t)GetProcAddress(mod, proc);
if (!sym)
{
set_dl_error();

View File

@ -96,6 +96,12 @@
#include <unistd.h> /* stat() is defined here */
#endif
#if !defined(RARCH_CONSOLE) && defined(RARCH_INTERNAL)
#ifdef __WINRT__
#include <uwp/uwp_func.h>
#endif
#endif
/* Assume W-functions do not work below Win2K and Xbox platforms */
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0500 || defined(_XBOX)
@ -1005,17 +1011,36 @@ void fill_pathname_expand_special(char *out_path,
const char *in_path, size_t size)
{
#if !defined(RARCH_CONSOLE) && defined(RARCH_INTERNAL)
if (*in_path == '~')
if (in_path[0] == '~')
{
const char *home = getenv("HOME");
if (home)
char *home_dir = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
home_dir[0] = '\0';
fill_pathname_home_dir(home_dir,
PATH_MAX_LENGTH * sizeof(char));
if (*home_dir)
{
size_t src_size = strlcpy(out_path, home, size);
size_t src_size = strlcpy(out_path, home_dir, size);
retro_assert(src_size < size);
out_path += src_size;
size -= src_size;
in_path++;
if (
(in_path[1] == '/')
#ifdef _WIN32
|| (in_path[1] == '\\')
#endif
)
{
in_path += 2;
}
else
{
in_path++;
}
}
}
else if ((in_path[0] == ':') &&
@ -1027,23 +1052,24 @@ void fill_pathname_expand_special(char *out_path,
)
)
{
size_t src_size;
char *application_dir = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
application_dir[0] = '\0';
fill_pathname_application_path(application_dir,
fill_pathname_application_dir(application_dir,
PATH_MAX_LENGTH * sizeof(char));
path_basedir_wrapper(application_dir);
src_size = strlcpy(out_path, application_dir, size);
retro_assert(src_size < size);
if (*application_dir)
{
size_t src_size = strlcpy(out_path, application_dir, size);
retro_assert(src_size < size);
free(application_dir);
free(application_dir);
out_path += src_size;
size -= src_size;
in_path += 2;
out_path += src_size;
size -= src_size;
in_path += 2;
}
}
#endif
@ -1058,7 +1084,7 @@ void fill_pathname_abbreviate_special(char *out_path,
const char *candidates[3];
const char *notations[3];
char *application_dir = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
const char *home = getenv("HOME");
char *home_dir = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
application_dir[0] = '\0';
@ -1070,16 +1096,17 @@ void fill_pathname_abbreviate_special(char *out_path,
/* ugly hack - use application_dir pointer
* before filling it in. C89 reasons */
candidates[0] = application_dir;
candidates[1] = home;
candidates[1] = home_dir;
candidates[2] = NULL;
notations [0] = ":";
notations [1] = "~";
notations [2] = NULL;
fill_pathname_application_path(application_dir,
fill_pathname_application_dir(application_dir,
PATH_MAX_LENGTH * sizeof(char));
fill_pathname_home_dir(home_dir,
PATH_MAX_LENGTH * sizeof(char));
path_basedir_wrapper(application_dir);
for (i = 0; candidates[i]; i++)
{
@ -1107,6 +1134,7 @@ void fill_pathname_abbreviate_special(char *out_path,
}
free(application_dir);
free(home_dir);
#endif
retro_assert(strlcpy(out_path, in_path, size) < size);
@ -1148,7 +1176,7 @@ void fill_pathname_application_path(char *s, size_t len)
CFBundleRef bundle = CFBundleGetMainBundle();
#endif
#ifdef _WIN32
DWORD ret;
DWORD ret = 0;
wchar_t wstr[PATH_MAX_LENGTH] = {0};
#endif
#ifdef __HAIKU__
@ -1160,11 +1188,11 @@ void fill_pathname_application_path(char *s, size_t len)
if (!len)
return;
#ifdef _WIN32
#if defined(_WIN32)
#ifdef LEGACY_WIN32
ret = GetModuleFileNameA(GetModuleHandle(NULL), s, len);
ret = GetModuleFileNameA(NULL, s, len);
#else
ret = GetModuleFileNameW(GetModuleHandle(NULL), wstr, ARRAY_SIZE(wstr));
ret = GetModuleFileNameW(NULL, wstr, ARRAY_SIZE(wstr));
if (*wstr)
{
@ -1233,4 +1261,27 @@ void fill_pathname_application_path(char *s, size_t len)
}
#endif
}
void fill_pathname_application_dir(char *s, size_t len)
{
#ifdef __WINRT__
strlcpy(s, uwp_dir_install, len);
#else
fill_pathname_application_path(s, len);
path_basedir_wrapper(s);
#endif
}
void fill_pathname_home_dir(char *s, size_t len)
{
#ifdef __WINRT__
strlcpy(s, uwp_dir_data, len);
#else
const char *home = getenv("HOME");
if (home)
strlcpy(s, home, len);
else
*s = 0;
#endif
}
#endif

View File

@ -38,7 +38,7 @@ extern nbio_intf_t nbio_stdio;
static nbio_intf_t *internal_nbio = &nbio_linux;
#elif defined(HAVE_MMAP) && defined(BSD)
static nbio_intf_t *internal_nbio = &nbio_mmap_unix;
#elif defined(_WIN32) && !defined(_XBOX)
#elif defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
static nbio_intf_t *internal_nbio = &nbio_mmap_win32;
#else
static nbio_intf_t *internal_nbio = &nbio_stdio;

View File

@ -462,6 +462,8 @@ void fill_pathname_slash(char *path, size_t size);
#if !defined(RARCH_CONSOLE) && defined(RARCH_INTERNAL)
void fill_pathname_application_path(char *buf, size_t size);
void fill_pathname_application_dir(char *buf, size_t size);
void fill_pathname_home_dir(char *buf, size_t size);
#endif
/**

View File

@ -359,12 +359,14 @@ static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info)
}
}
#ifndef __WINRT__
if (settings->bools.menu_show_core_updater)
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_DELETE),
msg_hash_to_str(MENU_ENUM_LABEL_CORE_DELETE),
MENU_ENUM_LABEL_CORE_DELETE,
MENU_SETTING_ACTION_CORE_DELETE, 0, 0);
#endif
return 0;
}
@ -3102,6 +3104,7 @@ static unsigned menu_displaylist_parse_options(
MENU_SETTING_ACTION, 0, 0);
count++;
#elif defined(HAVE_NETWORKING)
#ifndef __WINRT__
if (settings->bools.menu_show_core_updater)
{
menu_entries_append_enum(info->list,
@ -3111,6 +3114,7 @@ static unsigned menu_displaylist_parse_options(
MENU_SETTING_ACTION, 0, 0);
count++;
}
#endif
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_THUMBNAILS_UPDATER_LIST),
@ -4150,7 +4154,7 @@ bool menu_displaylist_process(menu_displaylist_info_t *info)
if (info->need_sort)
file_list_sort_on_alt(info->list);
#if defined(HAVE_NETWORKING)
#if defined(HAVE_NETWORKING) && !defined(__WINRT__)
if (settings->bools.menu_show_core_updater && !settings->bools.kiosk_mode_enable)
{
if (info->download_core)

View File

@ -148,7 +148,7 @@ static menu_display_ctx_driver_t *menu_display_ctx_drivers[] = {
#ifdef WIIU
&menu_display_ctx_wiiu,
#endif
#if defined(_WIN32) && !defined(_XBOX)
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
&menu_display_ctx_gdi,
#endif
#ifdef DJGPP

View File

@ -0,0 +1,51 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.168
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RetroArch-msvc2017-UWP", "msvc-2017-UWP\RetroArch-msvc2017-UWP.vcxproj", "{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Debug|ARM.ActiveCfg = Debug|ARM
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Debug|ARM.Build.0 = Debug|ARM
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Debug|ARM.Deploy.0 = Debug|ARM
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Debug|ARM64.ActiveCfg = Debug|ARM64
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Debug|ARM64.Build.0 = Debug|ARM64
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Debug|ARM64.Deploy.0 = Debug|ARM64
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Debug|x64.ActiveCfg = Debug|x64
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Debug|x64.Build.0 = Debug|x64
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Debug|x64.Deploy.0 = Debug|x64
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Debug|x86.ActiveCfg = Debug|Win32
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Debug|x86.Build.0 = Debug|Win32
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Debug|x86.Deploy.0 = Debug|Win32
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Release|ARM.ActiveCfg = Release|ARM
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Release|ARM.Build.0 = Release|ARM
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Release|ARM.Deploy.0 = Release|ARM
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Release|ARM64.ActiveCfg = Release|ARM64
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Release|ARM64.Build.0 = Release|ARM64
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Release|ARM64.Deploy.0 = Release|ARM64
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Release|x64.ActiveCfg = Release|x64
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Release|x64.Build.0 = Release|x64
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Release|x64.Deploy.0 = Release|x64
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Release|x86.ActiveCfg = Release|Win32
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Release|x86.Build.0 = Release|Win32
{F5E937B6-1BA0-4446-B94B-F3BBDEF908F4}.Release|x86.Deploy.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2A811B94-2232-4C4E-A88E-33B0CDF139A2}
EndGlobalSection
EndGlobal

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,29 @@
<?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" IgnorableNamespaces="uap mp">
<Identity Name="1e4cf179-f3c2-404f-b9f3-cb2070a5aad8" Publisher="CN=krzys" Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="1e4cf179-f3c2-404f-b9f3-cb2070a5aad8" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>RetroArch</DisplayName>
<PublisherDisplayName>libretro</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="RetroArch.App">
<uap:VisualElements DisplayName="RetroArch" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="RetroArch is a frontend for emulators, game engines and media players. It enables you to run classic games on a wide range of computers and consoles through its slick graphical interface. Settings are also unified so configuration is done once and for all. RetroArch has advanced features like shaders, netplay, rewinding, next-frame response times, and more!" BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square310x310Logo="Assets\LargeTile.png" Square71x71Logo="Assets\SmallTile.png">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<Capability Name="internetClientServer" />
</Capabilities>
</Package>

View File

@ -0,0 +1,526 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{f5e937b6-1ba0-4446-b94b-f3bbdef908f4}</ProjectGuid>
<Keyword>DirectXApp</Keyword>
<RootNamespace>RetroArchUWP</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.15063.0</WindowsTargetPlatformMinVersion>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ImageContentTask.props" />
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\MeshContentTask.props" />
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ShaderGraphContentTask.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<PackageCertificateKeyFile>msvc-2017-UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<Link>
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; dxguid.lib; %(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm</AdditionalLibraryDirectories>
<AdditionalOptions>/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\..\;$(MSBuildProjectDirectory)\..\..\..\deps\rcheevos\include;$(MSBuildProjectDirectory)\..\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\..\deps;$(MSBuildProjectDirectory)\..\..\..\deps\glslang;$(MSBuildProjectDirectory)\..\..\..\deps\SPIRV-Cross;$(MSBuildProjectDirectory)\..\..\..\deps\stb;$(MSBuildProjectDirectory)\..\..\..\gfx\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WIN32;HAVE_MAIN;HAVE_DYNAMIC;HAVE_XAUDIO2;RARCH_INTERNAL;HAVE_CC_RESAMPLER;HAVE_SLANG;HAVE_SPIRV_CROSS;HAVE_UPDATE_ASSETS;HAVE_D3D;HAVE_D3D11;HAVE_D3D12;ENABLE_HLSL;RC_DISABLE_LUA;HAVE_CHEEVOS;HAVE_RUNAHEAD;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_FBO;HAVE_ZLIB;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;HAVE_IMAGEVIEWER;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_XINPUT;HAVE_XINPUT2;HAVE_XAUDIO;HAVE_DIRECTX;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_NETPLAYDISCOVERY;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_RGUI;HAVE_MENU;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT;HAVE_STATIC_DUMMY;HAVE_STATIC_VIDEO_FILTERS;HAVE_STATIC_AUDIO_FILTERS</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Link>
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; dxguid.lib; %(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm</AdditionalLibraryDirectories>
<AdditionalOptions>/nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\..\;$(MSBuildProjectDirectory)\..\..\..\deps\rcheevos\include;$(MSBuildProjectDirectory)\..\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\..\deps;$(MSBuildProjectDirectory)\..\..\..\deps\glslang;$(MSBuildProjectDirectory)\..\..\..\deps\SPIRV-Cross;$(MSBuildProjectDirectory)\..\..\..\deps\stb;$(MSBuildProjectDirectory)\..\..\..\gfx\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WIN32;HAVE_MAIN;HAVE_DYNAMIC;HAVE_XAUDIO2;RARCH_INTERNAL;HAVE_CC_RESAMPLER;HAVE_SLANG;HAVE_SPIRV_CROSS;HAVE_UPDATE_ASSETS;HAVE_D3D;HAVE_D3D11;HAVE_D3D12;ENABLE_HLSL;RC_DISABLE_LUA;HAVE_CHEEVOS;HAVE_RUNAHEAD;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;HAVE_IMAGEVIEWER;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_XINPUT;HAVE_XINPUT2;HAVE_XAUDIO;HAVE_DIRECTX;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_NETPLAYDISCOVERY;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_MENU;HAVE_RGUI;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT;HAVE_STATIC_DUMMY;HAVE_STATIC_VIDEO_FILTERS;HAVE_STATIC_AUDIO_FILTERS</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<Link>
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; dxguid.lib; %(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm64; $(VCInstallDir)\lib\arm64</AdditionalLibraryDirectories>
<AdditionalOptions>/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\..\;$(MSBuildProjectDirectory)\..\..\..\deps\rcheevos\include;$(MSBuildProjectDirectory)\..\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\..\deps;$(MSBuildProjectDirectory)\..\..\..\deps\glslang;$(MSBuildProjectDirectory)\..\..\..\deps\SPIRV-Cross;$(MSBuildProjectDirectory)\..\..\..\deps\stb;$(MSBuildProjectDirectory)\..\..\..\gfx\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WIN32;HAVE_MAIN;HAVE_DYNAMIC;HAVE_XAUDIO2;RARCH_INTERNAL;HAVE_CC_RESAMPLER;HAVE_SLANG;HAVE_SPIRV_CROSS;HAVE_UPDATE_ASSETS;HAVE_D3D;HAVE_D3D11;HAVE_D3D12;ENABLE_HLSL;RC_DISABLE_LUA;HAVE_CHEEVOS;HAVE_RUNAHEAD;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_FBO;HAVE_ZLIB;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;HAVE_IMAGEVIEWER;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_XINPUT;HAVE_XINPUT2;HAVE_XAUDIO;HAVE_DIRECTX;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_NETPLAYDISCOVERY;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_RGUI;HAVE_MENU;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT;HAVE_STATIC_DUMMY;HAVE_STATIC_VIDEO_FILTERS;HAVE_STATIC_AUDIO_FILTERS</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Link>
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; dxguid.lib; %(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm64; $(VCInstallDir)\lib\arm64</AdditionalLibraryDirectories>
<AdditionalOptions>/nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\..\;$(MSBuildProjectDirectory)\..\..\..\deps\rcheevos\include;$(MSBuildProjectDirectory)\..\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\..\deps;$(MSBuildProjectDirectory)\..\..\..\deps\glslang;$(MSBuildProjectDirectory)\..\..\..\deps\SPIRV-Cross;$(MSBuildProjectDirectory)\..\..\..\deps\stb;$(MSBuildProjectDirectory)\..\..\..\gfx\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WIN32;HAVE_MAIN;HAVE_DYNAMIC;HAVE_XAUDIO2;RARCH_INTERNAL;HAVE_CC_RESAMPLER;HAVE_SLANG;HAVE_SPIRV_CROSS;HAVE_UPDATE_ASSETS;HAVE_D3D;HAVE_D3D11;HAVE_D3D12;ENABLE_HLSL;RC_DISABLE_LUA;HAVE_CHEEVOS;HAVE_RUNAHEAD;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;HAVE_IMAGEVIEWER;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_XINPUT;HAVE_XINPUT2;HAVE_XAUDIO;HAVE_DIRECTX;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_NETPLAYDISCOVERY;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_MENU;HAVE_RGUI;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT;HAVE_STATIC_DUMMY;HAVE_STATIC_VIDEO_FILTERS;HAVE_STATIC_AUDIO_FILTERS</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Link>
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; dxguid.lib; %(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\..\;$(MSBuildProjectDirectory)\..\..\..\deps\rcheevos\include;$(MSBuildProjectDirectory)\..\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\..\deps;$(MSBuildProjectDirectory)\..\..\..\deps\glslang;$(MSBuildProjectDirectory)\..\..\..\deps\SPIRV-Cross;$(MSBuildProjectDirectory)\..\..\..\deps\stb;$(MSBuildProjectDirectory)\..\..\..\gfx\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WIN32;HAVE_MAIN;HAVE_DYNAMIC;HAVE_XAUDIO2;RARCH_INTERNAL;HAVE_CC_RESAMPLER;HAVE_SLANG;HAVE_SPIRV_CROSS;HAVE_UPDATE_ASSETS;HAVE_D3D;HAVE_D3D11;HAVE_D3D12;ENABLE_HLSL;RC_DISABLE_LUA;HAVE_CHEEVOS;HAVE_RUNAHEAD;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_FBO;HAVE_ZLIB;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;HAVE_IMAGEVIEWER;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_XINPUT;HAVE_XINPUT2;HAVE_XAUDIO;HAVE_DIRECTX;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_NETPLAYDISCOVERY;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_RGUI;HAVE_MENU;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT;HAVE_STATIC_DUMMY;HAVE_STATIC_VIDEO_FILTERS;HAVE_STATIC_AUDIO_FILTERS</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Link>
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; dxguid.lib; %(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\..\;$(MSBuildProjectDirectory)\..\..\..\deps\rcheevos\include;$(MSBuildProjectDirectory)\..\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\..\deps;$(MSBuildProjectDirectory)\..\..\..\deps\glslang;$(MSBuildProjectDirectory)\..\..\..\deps\SPIRV-Cross;$(MSBuildProjectDirectory)\..\..\..\deps\stb;$(MSBuildProjectDirectory)\..\..\..\gfx\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WIN32;HAVE_MAIN;HAVE_DYNAMIC;HAVE_XAUDIO2;RARCH_INTERNAL;HAVE_CC_RESAMPLER;HAVE_SLANG;HAVE_SPIRV_CROSS;HAVE_UPDATE_ASSETS;HAVE_D3D;HAVE_D3D11;HAVE_D3D12;ENABLE_HLSL;RC_DISABLE_LUA;HAVE_CHEEVOS;HAVE_RUNAHEAD;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;HAVE_IMAGEVIEWER;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_XINPUT;HAVE_XINPUT2;HAVE_XAUDIO;HAVE_DIRECTX;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_NETPLAYDISCOVERY;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_MENU;HAVE_RGUI;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT;HAVE_STATIC_DUMMY;HAVE_STATIC_VIDEO_FILTERS;HAVE_STATIC_AUDIO_FILTERS</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Link>
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; dxguid.lib; %(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64</AdditionalLibraryDirectories>
<AdditionalOptions>/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\..\;$(MSBuildProjectDirectory)\..\..\..\deps\rcheevos\include;$(MSBuildProjectDirectory)\..\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\..\deps;$(MSBuildProjectDirectory)\..\..\..\deps\glslang;$(MSBuildProjectDirectory)\..\..\..\deps\SPIRV-Cross;$(MSBuildProjectDirectory)\..\..\..\deps\stb;$(MSBuildProjectDirectory)\..\..\..\gfx\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WIN32;HAVE_MAIN;HAVE_DYNAMIC;HAVE_XAUDIO2;RARCH_INTERNAL;HAVE_CC_RESAMPLER;HAVE_SLANG;HAVE_SPIRV_CROSS;HAVE_UPDATE_ASSETS;HAVE_D3D;HAVE_D3D11;HAVE_D3D12;ENABLE_HLSL;RC_DISABLE_LUA;HAVE_CHEEVOS;HAVE_RUNAHEAD;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_FBO;HAVE_ZLIB;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;HAVE_IMAGEVIEWER;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_XINPUT;HAVE_XINPUT2;HAVE_XAUDIO;HAVE_DIRECTX;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_NETPLAYDISCOVERY;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_RGUI;HAVE_MENU;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT;HAVE_STATIC_DUMMY;HAVE_STATIC_VIDEO_FILTERS;HAVE_STATIC_AUDIO_FILTERS</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Link>
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; dxguid.lib; %(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64</AdditionalLibraryDirectories>
<AdditionalOptions>/nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\..\;$(MSBuildProjectDirectory)\..\..\..\deps\rcheevos\include;$(MSBuildProjectDirectory)\..\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\..\deps;$(MSBuildProjectDirectory)\..\..\..\deps\glslang;$(MSBuildProjectDirectory)\..\..\..\deps\SPIRV-Cross;$(MSBuildProjectDirectory)\..\..\..\deps\stb;$(MSBuildProjectDirectory)\..\..\..\gfx\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WIN32;HAVE_MAIN;HAVE_DYNAMIC;HAVE_XAUDIO2;RARCH_INTERNAL;HAVE_CC_RESAMPLER;HAVE_SLANG;HAVE_SPIRV_CROSS;HAVE_UPDATE_ASSETS;HAVE_D3D;HAVE_D3D11;HAVE_D3D12;ENABLE_HLSL;RC_DISABLE_LUA;HAVE_CHEEVOS;HAVE_RUNAHEAD;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;HAVE_IMAGEVIEWER;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_XINPUT;HAVE_XINPUT2;HAVE_XAUDIO;HAVE_DIRECTX;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_NETPLAYDISCOVERY;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_MENU;HAVE_RGUI;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT;HAVE_STATIC_DUMMY;HAVE_STATIC_VIDEO_FILTERS;HAVE_STATIC_AUDIO_FILTERS</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\griffin\griffin.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\..\..\griffin\griffin_cpp.cpp" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\uwp\uwp_main.cpp" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="avcodec-57.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="avformat-57.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="avutil-55.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="cores\mednafen_snes_libretro.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="cores\pcsx_rearmed_libretro.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libass-9.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libbluray-2.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libbz2-1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libcelt0-2.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="LIBEAY32.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libexpat-1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libffi-6.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libfontconfig-1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libfreetype-6.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libfribidi-0.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libgcc_s_seh-1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libglib-2.0-0.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libgmp-10.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libgnutls-30.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libgraphite2.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libgsm.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libharfbuzz-0.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libhogweed-4.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libiconv-2.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libicudt58.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libicuin58.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libicuuc58.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libidn2-0.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libintl-8.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libjasper-4.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libjpeg-8.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="liblcms2-2.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="liblzma-5.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libmng-2.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libmodplug-1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libmp3lame-0.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libnettle-6.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libogg-0.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libopencore-amrnb-0.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libopencore-amrwb-0.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libopenjp2-7.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libopus-0.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libp11-kit-0.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libpcre-1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libpcre2-16-0.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libpng16-16.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="librtmp-1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libspeex-1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libstdc++-6.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libtasn1-6.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libtheoradec-1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libtheoraenc-1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libtiff-5.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libunistring-2.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libvorbis-0.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libvorbisenc-2.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libvpx-1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libwavpack-1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libwebp-7.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libwebpdemux-2.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libwebpmux-3.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libwinpthread-1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libx264-155.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libx265.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="libxml2-2.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="msvc-2017-UWP_TemporaryKey.pfx" />
<None Include="SSLEAY32.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="swresample-2.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="swscale-4.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="xvidcore.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<None Include="zlib1.dll">
<DeploymentContent>true</DeploymentContent>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\uwp\uwp_func.h" />
<ClInclude Include="..\..\..\uwp\uwp_main.h" />
</ItemGroup>
<ItemGroup>
<Image Include="Assets\LargeTile.scale-100.png" />
<Image Include="Assets\LargeTile.scale-200.png" />
<Image Include="Assets\LargeTile.scale-400.png" />
<Image Include="Assets\SmallTile.scale-100.png" />
<Image Include="Assets\SmallTile.scale-200.png" />
<Image Include="Assets\SmallTile.scale-400.png" />
<Image Include="Assets\SplashScreen.scale-100.png" />
<Image Include="Assets\SplashScreen.scale-200.png" />
<Image Include="Assets\SplashScreen.scale-400.png" />
<Image Include="Assets\Square150x150Logo.scale-100.png" />
<Image Include="Assets\Square150x150Logo.scale-200.png" />
<Image Include="Assets\Square150x150Logo.scale-400.png" />
<Image Include="Assets\Square44x44Logo.altform-unplated_targetsize-16.png" />
<Image Include="Assets\Square44x44Logo.altform-unplated_targetsize-256.png" />
<Image Include="Assets\Square44x44Logo.altform-unplated_targetsize-48.png" />
<Image Include="Assets\Square44x44Logo.scale-100.png" />
<Image Include="Assets\Square44x44Logo.scale-200.png" />
<Image Include="Assets\Square44x44Logo.scale-400.png" />
<Image Include="Assets\Square44x44Logo.targetsize-16.png" />
<Image Include="Assets\Square44x44Logo.targetsize-256.png" />
<Image Include="Assets\Square44x44Logo.targetsize-48.png" />
<Image Include="Assets\StoreLogo.scale-100.png" />
<Image Include="Assets\StoreLogo.scale-200.png" />
<Image Include="Assets\StoreLogo.scale-400.png" />
<Image Include="Assets\Wide310x150Logo.scale-100.png" />
<Image Include="Assets\Wide310x150Logo.scale-200.png" />
<Image Include="Assets\Wide310x150Logo.scale-400.png" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ImageContentTask.targets" />
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\MeshContentTask.targets" />
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ShaderGraphContentTask.targets" />
</ImportGroup>
</Project>

View File

@ -0,0 +1,340 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="uwp">
<UniqueIdentifier>{1246fa09-e114-4a52-88c2-657b2f13d9fb}</UniqueIdentifier>
</Filter>
<Filter Include="griffin">
<UniqueIdentifier>{32de9679-6494-4933-afa2-430fd975e506}</UniqueIdentifier>
</Filter>
<Filter Include="cores">
<UniqueIdentifier>{73676219-cf54-454f-b6fa-9b192c1454f8}</UniqueIdentifier>
<Extensions>
</Extensions>
</Filter>
<Filter Include="core_deps">
<UniqueIdentifier>{bf1e643d-c518-4a77-a355-ae8a93efc18b}</UniqueIdentifier>
</Filter>
<Filter Include="Assets">
<UniqueIdentifier>{c3155604-6d38-494a-bfe0-861cef871cb2}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest" />
</ItemGroup>
<ItemGroup>
<None Include="msvc-2017-UWP_TemporaryKey.pfx" />
<None Include="libwinpthread-1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="cores\mednafen_snes_libretro.dll">
<Filter>cores</Filter>
</None>
<None Include="cores\pcsx_rearmed_libretro.dll">
<Filter>cores</Filter>
</None>
<None Include="zlib1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="avcodec-57.dll">
<Filter>core_deps</Filter>
</None>
<None Include="avformat-57.dll">
<Filter>core_deps</Filter>
</None>
<None Include="avutil-55.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libass-9.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libbluray-2.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libbz2-1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libcelt0-2.dll">
<Filter>core_deps</Filter>
</None>
<None Include="LIBEAY32.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libexpat-1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libffi-6.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libfontconfig-1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libfreetype-6.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libfribidi-0.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libgcc_s_seh-1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libglib-2.0-0.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libgmp-10.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libgnutls-30.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libgraphite2.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libgsm.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libharfbuzz-0.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libhogweed-4.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libiconv-2.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libicudt58.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libicuin58.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libicuuc58.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libidn2-0.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libintl-8.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libjasper-4.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libjpeg-8.dll">
<Filter>core_deps</Filter>
</None>
<None Include="liblcms2-2.dll">
<Filter>core_deps</Filter>
</None>
<None Include="liblzma-5.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libmng-2.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libmodplug-1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libmp3lame-0.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libnettle-6.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libogg-0.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libopencore-amrnb-0.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libopencore-amrwb-0.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libopenjp2-7.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libopus-0.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libp11-kit-0.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libpcre-1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libpcre2-16-0.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libpng16-16.dll">
<Filter>core_deps</Filter>
</None>
<None Include="librtmp-1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libspeex-1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libstdc++-6.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libtasn1-6.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libtheoradec-1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libtheoraenc-1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libtiff-5.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libunistring-2.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libvorbis-0.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libvorbisenc-2.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libvpx-1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libwavpack-1.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libwebp-7.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libwebpdemux-2.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libwebpmux-3.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libx264-155.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libx265.dll">
<Filter>core_deps</Filter>
</None>
<None Include="libxml2-2.dll">
<Filter>core_deps</Filter>
</None>
<None Include="SSLEAY32.dll">
<Filter>core_deps</Filter>
</None>
<None Include="swresample-2.dll">
<Filter>core_deps</Filter>
</None>
<None Include="swscale-4.dll">
<Filter>core_deps</Filter>
</None>
<None Include="xvidcore.dll">
<Filter>core_deps</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\uwp\uwp_main.h">
<Filter>uwp</Filter>
</ClInclude>
<ClInclude Include="..\..\..\uwp\uwp_func.h">
<Filter>uwp</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\griffin\griffin.c">
<Filter>griffin</Filter>
</ClCompile>
<ClCompile Include="..\..\..\griffin\griffin_cpp.cpp">
<Filter>griffin</Filter>
</ClCompile>
<ClCompile Include="..\..\..\uwp\uwp_main.cpp">
<Filter>uwp</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="Assets\SmallTile.scale-100.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\SmallTile.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\SmallTile.scale-400.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square150x150Logo.scale-100.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square150x150Logo.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square150x150Logo.scale-400.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Wide310x150Logo.scale-100.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Wide310x150Logo.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Wide310x150Logo.scale-400.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\LargeTile.scale-100.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\LargeTile.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\LargeTile.scale-400.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square44x44Logo.scale-100.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square44x44Logo.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square44x44Logo.scale-400.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square44x44Logo.targetsize-16.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square44x44Logo.targetsize-48.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square44x44Logo.targetsize-256.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square44x44Logo.altform-unplated_targetsize-16.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square44x44Logo.altform-unplated_targetsize-48.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square44x44Logo.altform-unplated_targetsize-256.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\SplashScreen.scale-100.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\SplashScreen.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\SplashScreen.scale-400.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\StoreLogo.scale-100.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\StoreLogo.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\StoreLogo.scale-400.png">
<Filter>Assets</Filter>
</Image>
</ItemGroup>
</Project>

Binary file not shown.

View File

@ -27,7 +27,7 @@
#include "ui_companion_driver.h"
static const ui_companion_driver_t *ui_companion_drivers[] = {
#if defined(_WIN32) && !defined(_XBOX)
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
&ui_companion_win32,
#endif
#if defined(HAVE_COCOA) || defined(HAVE_COCOA_METAL)

42
uwp/uwp_func.h Normal file
View File

@ -0,0 +1,42 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2018 - Krzysztof Haładyn
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _UWP_FUNC_H
#define _UWP_FUNC_H
#include <retro_miscellaneous.h>
#ifdef __cplusplus
extern "C" {
#endif
extern char uwp_dir_install[PATH_MAX_LENGTH];
extern char uwp_dir_data[PATH_MAX_LENGTH];
extern char uwp_device_family[128];
void* uwp_get_corewindow(void);
void uwp_input_next_frame(void);
bool uwp_keyboard_pressed(unsigned key);
int16_t uwp_mouse_state(unsigned port, unsigned id, bool screen);
int16_t uwp_pointer_state(unsigned idx, unsigned id, bool screen);
extern const struct rarch_key_map rarch_key_map_uwp[];
#ifdef __cplusplus
}
#endif
#endif _UWP_FUNC_H

595
uwp/uwp_main.cpp Normal file
View File

@ -0,0 +1,595 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2018 - Krzysztof Haładyn
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "uwp_main.h"
#include <retroarch.h>
#include <queues/task_queue.h>
#include <retro_timers.h>
#include <frontend/frontend.h>
#include <input/input_keymaps.h>
#include <input/input_driver.h>
#include <verbosity.h>
#include "uwp_func.h"
#include <ppltasks.h>
using namespace RetroArchUWP;
using namespace concurrency;
using namespace Windows::ApplicationModel;
using namespace Windows::ApplicationModel::Core;
using namespace Windows::ApplicationModel::Activation;
using namespace Windows::UI::Core;
using namespace Windows::UI::Input;
using namespace Windows::UI::ViewManagement;
using namespace Windows::Devices::Input;
using namespace Windows::System;
using namespace Windows::System::Profile;
using namespace Windows::Foundation;
using namespace Windows::Graphics::Display;
char uwp_dir_install[PATH_MAX_LENGTH];
char uwp_dir_data[PATH_MAX_LENGTH];
char uwp_device_family[128];
// Some keys are unavailable in the VirtualKey enum (wtf) but the old-style constants work
const struct rarch_key_map rarch_key_map_uwp[] = {
{ (unsigned int)VirtualKey::Back, RETROK_BACKSPACE },
{ (unsigned int)VirtualKey::Tab, RETROK_TAB },
{ (unsigned int)VirtualKey::Clear, RETROK_CLEAR },
{ (unsigned int)VirtualKey::Enter, RETROK_RETURN },
{ (unsigned int)VirtualKey::Pause, RETROK_PAUSE },
{ (unsigned int)VirtualKey::Escape, RETROK_ESCAPE },
{ (unsigned int)VirtualKey::ModeChange, RETROK_MODE },
{ (unsigned int)VirtualKey::Space, RETROK_SPACE },
{ (unsigned int)VirtualKey::PageUp, RETROK_PAGEUP },
{ (unsigned int)VirtualKey::PageDown, RETROK_PAGEDOWN },
{ (unsigned int)VirtualKey::End, RETROK_END },
{ (unsigned int)VirtualKey::Home, RETROK_HOME },
{ (unsigned int)VirtualKey::Left, RETROK_LEFT },
{ (unsigned int)VirtualKey::Up, RETROK_UP },
{ (unsigned int)VirtualKey::Right, RETROK_RIGHT },
{ (unsigned int)VirtualKey::Down, RETROK_DOWN },
{ (unsigned int)VirtualKey::Print, RETROK_PRINT },
{ (unsigned int)VirtualKey::Insert, RETROK_INSERT },
{ (unsigned int)VirtualKey::Delete, RETROK_DELETE },
{ (unsigned int)VirtualKey::Help, RETROK_HELP },
{ (unsigned int)VirtualKey::Number0, RETROK_0 },
{ (unsigned int)VirtualKey::Number1, RETROK_1 },
{ (unsigned int)VirtualKey::Number2, RETROK_2 },
{ (unsigned int)VirtualKey::Number3, RETROK_3 },
{ (unsigned int)VirtualKey::Number4, RETROK_4 },
{ (unsigned int)VirtualKey::Number5, RETROK_5 },
{ (unsigned int)VirtualKey::Number6, RETROK_6 },
{ (unsigned int)VirtualKey::Number7, RETROK_7 },
{ (unsigned int)VirtualKey::Number8, RETROK_8 },
{ (unsigned int)VirtualKey::Number9, RETROK_9 },
{ (unsigned int)VirtualKey::A, RETROK_a },
{ (unsigned int)VirtualKey::B, RETROK_b },
{ (unsigned int)VirtualKey::C, RETROK_c },
{ (unsigned int)VirtualKey::D, RETROK_d },
{ (unsigned int)VirtualKey::E, RETROK_e },
{ (unsigned int)VirtualKey::F, RETROK_f },
{ (unsigned int)VirtualKey::G, RETROK_g },
{ (unsigned int)VirtualKey::H, RETROK_h },
{ (unsigned int)VirtualKey::I, RETROK_i },
{ (unsigned int)VirtualKey::J, RETROK_j },
{ (unsigned int)VirtualKey::K, RETROK_k },
{ (unsigned int)VirtualKey::L, RETROK_l },
{ (unsigned int)VirtualKey::M, RETROK_m },
{ (unsigned int)VirtualKey::N, RETROK_n },
{ (unsigned int)VirtualKey::O, RETROK_o },
{ (unsigned int)VirtualKey::P, RETROK_p },
{ (unsigned int)VirtualKey::Q, RETROK_q },
{ (unsigned int)VirtualKey::R, RETROK_r },
{ (unsigned int)VirtualKey::S, RETROK_s },
{ (unsigned int)VirtualKey::T, RETROK_t },
{ (unsigned int)VirtualKey::U, RETROK_u },
{ (unsigned int)VirtualKey::V, RETROK_v },
{ (unsigned int)VirtualKey::W, RETROK_w },
{ (unsigned int)VirtualKey::X, RETROK_x },
{ (unsigned int)VirtualKey::Y, RETROK_y },
{ (unsigned int)VirtualKey::Z, RETROK_z },
{ (unsigned int)VirtualKey::LeftWindows, RETROK_LSUPER },
{ (unsigned int)VirtualKey::RightWindows, RETROK_RSUPER },
{ (unsigned int)VirtualKey::Application, RETROK_MENU },
{ (unsigned int)VirtualKey::NumberPad0, RETROK_KP0 },
{ (unsigned int)VirtualKey::NumberPad1, RETROK_KP1 },
{ (unsigned int)VirtualKey::NumberPad2, RETROK_KP2 },
{ (unsigned int)VirtualKey::NumberPad3, RETROK_KP3 },
{ (unsigned int)VirtualKey::NumberPad4, RETROK_KP4 },
{ (unsigned int)VirtualKey::NumberPad5, RETROK_KP5 },
{ (unsigned int)VirtualKey::NumberPad6, RETROK_KP6 },
{ (unsigned int)VirtualKey::NumberPad7, RETROK_KP7 },
{ (unsigned int)VirtualKey::NumberPad8, RETROK_KP8 },
{ (unsigned int)VirtualKey::NumberPad9, RETROK_KP9 },
{ (unsigned int)VirtualKey::Multiply, RETROK_KP_MULTIPLY },
{ (unsigned int)VirtualKey::Add, RETROK_KP_PLUS },
{ (unsigned int)VirtualKey::Subtract, RETROK_KP_MINUS },
{ (unsigned int)VirtualKey::Decimal, RETROK_KP_PERIOD },
{ (unsigned int)VirtualKey::Divide, RETROK_KP_DIVIDE },
{ (unsigned int)VirtualKey::F1, RETROK_F1 },
{ (unsigned int)VirtualKey::F2, RETROK_F2 },
{ (unsigned int)VirtualKey::F3, RETROK_F3 },
{ (unsigned int)VirtualKey::F4, RETROK_F4 },
{ (unsigned int)VirtualKey::F5, RETROK_F5 },
{ (unsigned int)VirtualKey::F6, RETROK_F6 },
{ (unsigned int)VirtualKey::F7, RETROK_F7 },
{ (unsigned int)VirtualKey::F8, RETROK_F8 },
{ (unsigned int)VirtualKey::F9, RETROK_F9 },
{ (unsigned int)VirtualKey::F10, RETROK_F10 },
{ (unsigned int)VirtualKey::F11, RETROK_F11 },
{ (unsigned int)VirtualKey::F12, RETROK_F12 },
{ (unsigned int)VirtualKey::F13, RETROK_F13 },
{ (unsigned int)VirtualKey::F14, RETROK_F14 },
{ (unsigned int)VirtualKey::F15, RETROK_F15 },
{ (unsigned int)VirtualKey::NumberKeyLock, RETROK_NUMLOCK },
{ (unsigned int)VirtualKey::Scroll, RETROK_SCROLLOCK },
{ (unsigned int)VirtualKey::LeftShift, RETROK_LSHIFT },
{ (unsigned int)VirtualKey::RightShift, RETROK_RSHIFT },
{ (unsigned int)VirtualKey::LeftControl, RETROK_LCTRL },
{ (unsigned int)VirtualKey::RightControl, RETROK_RCTRL },
{ (unsigned int)VirtualKey::LeftMenu, RETROK_LALT },
{ (unsigned int)VirtualKey::RightMenu, RETROK_RALT },
{ VK_RETURN, RETROK_KP_ENTER },
{ (unsigned int)VirtualKey::CapitalLock, RETROK_CAPSLOCK },
{ VK_OEM_1, RETROK_SEMICOLON },
{ VK_OEM_PLUS, RETROK_EQUALS },
{ VK_OEM_COMMA, RETROK_COMMA },
{ VK_OEM_MINUS, RETROK_MINUS },
{ VK_OEM_PERIOD, RETROK_PERIOD },
{ VK_OEM_2, RETROK_SLASH },
{ VK_OEM_3, RETROK_BACKQUOTE },
{ VK_OEM_4, RETROK_LEFTBRACKET },
{ VK_OEM_5, RETROK_BACKSLASH },
{ VK_OEM_6, RETROK_RIGHTBRACKET },
{ VK_OEM_7, RETROK_QUOTE },
{ 0, RETROK_UNKNOWN }
};
struct uwp_input_state_t {
short mouse_screen_x = 0, mouse_screen_y = 0;
short mouse_rel_x = 0, mouse_rel_y = 0;
bool mouse_left = false, mouse_right = false, mouse_middle = false;
bool mouse_button4 = false, mouse_button5 = false;
short mouse_wheel_left = 0, mouse_wheel_up = 0;
short touch_screen_x = 0, touch_screen_y = 0;
short touch_rel_x = 0, touch_rel_y = 0;
bool touch_touched = false;
};
struct uwp_input_state_t uwp_current_input, uwp_next_input;
// The main function is only used to initialize our IFrameworkView class.
[Platform::MTAThread]
int main(Platform::Array<Platform::String^>^)
{
Platform::String^ install_dir = Windows::ApplicationModel::Package::Current->InstalledLocation->Path + L"\\";
wcstombs(uwp_dir_install, install_dir->Data(), PATH_MAX_LENGTH);
Platform::String^ data_dir = Windows::Storage::ApplicationData::Current->LocalFolder->Path + L"\\";
wcstombs(uwp_dir_data, data_dir->Data(), PATH_MAX_LENGTH);
wcstombs(uwp_device_family, AnalyticsInfo::VersionInfo->DeviceFamily->Data(), 128);
RARCH_LOG("Data dir: %ls\n", data_dir->Data());
RARCH_LOG("Install dir: %ls\n", install_dir->Data());
auto direct3DApplicationSource = ref new Direct3DApplicationSource();
CoreApplication::Run(direct3DApplicationSource);
return 0;
}
IFrameworkView^ Direct3DApplicationSource::CreateView()
{
return ref new App();
}
App^ App::m_instance;
App::App() :
m_initialized(false),
m_windowClosed(false),
m_windowVisible(true),
m_windowFocused(true),
m_windowResized(false)
{
m_instance = this;
}
// The first method called when the IFrameworkView is being created.
void App::Initialize(CoreApplicationView^ applicationView)
{
// Register event handlers for app lifecycle. This example includes Activated, so that we
// can make the CoreWindow active and start rendering on the window.
applicationView->Activated +=
ref new TypedEventHandler<CoreApplicationView^, IActivatedEventArgs^>(this, &App::OnActivated);
CoreApplication::Suspending +=
ref new EventHandler<SuspendingEventArgs^>(this, &App::OnSuspending);
CoreApplication::Resuming +=
ref new EventHandler<Platform::Object^>(this, &App::OnResuming);
}
// Called when the CoreWindow object is created (or re-created).
void App::SetWindow(CoreWindow^ window)
{
window->SizeChanged +=
ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>(this, &App::OnWindowSizeChanged);
window->VisibilityChanged +=
ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &App::OnVisibilityChanged);
window->Activated +=
ref new TypedEventHandler<CoreWindow^, WindowActivatedEventArgs^>(this, &App::OnWindowActivated);
window->Closed +=
ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &App::OnWindowClosed);
window->KeyDown +=
ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &App::OnKey);
window->KeyUp +=
ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &App::OnKey);
window->PointerPressed +=
ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &App::OnPointer);
window->PointerReleased +=
ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &App::OnPointer);
window->PointerMoved +=
ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &App::OnPointer);
window->PointerWheelChanged +=
ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &App::OnPointer);
DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
currentDisplayInformation->DpiChanged +=
ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnDpiChanged);
currentDisplayInformation->OrientationChanged +=
ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnOrientationChanged);
DisplayInformation::DisplayContentsInvalidated +=
ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnDisplayContentsInvalidated);
Windows::UI::Core::SystemNavigationManager::GetForCurrentView()->BackRequested +=
ref new EventHandler<Windows::UI::Core::BackRequestedEventArgs^>(this, &App::OnBackRequested);
}
// Initializes scene resources, or loads a previously saved app state.
void App::Load(Platform::String^ entryPoint)
{
int ret = rarch_main(NULL, NULL, NULL);
if (ret != 0)
{
RARCH_ERR("Init failed\n");
CoreApplication::Exit();
return;
}
m_initialized = true;
}
// This method is called after the window becomes active.
void App::Run()
{
if (!m_initialized)
{
RARCH_WARN("Initialization failed, so not running\n");
return;
}
bool x = false;
while (true)
{
CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
unsigned sleep_ms = 0;
int ret = runloop_iterate(&sleep_ms);
if (ret == 1 && sleep_ms > 0)
retro_sleep(sleep_ms);
task_queue_check();
if (!x)
{
/* HACK: I have no idea why is this necessary but it is required to get proper scaling on Xbox *
* Perhaps PreferredLaunchViewSize is broken and we need to wait until the app starts to call TryResizeView */
m_windowResized = true;
x = true;
}
if (ret == -1)
break;
}
}
// Required for IFrameworkView.
// Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView
// class is torn down while the app is in the foreground.
void App::Uninitialize()
{
main_exit(NULL);
}
// Application lifecycle event handlers.
void App::OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args)
{
// Run() won't start until the CoreWindow is activated.
CoreWindow::GetForCurrentThread()->Activate();
}
void App::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ args)
{
// Save app state asynchronously after requesting a deferral. Holding a deferral
// indicates that the application is busy performing suspending operations. Be
// aware that a deferral may not be held indefinitely. After about five seconds,
// the app will be forced to exit.
SuspendingDeferral^ deferral = args->SuspendingOperation->GetDeferral();
create_task([this, deferral]()
{
// TODO: Maybe creating a save state here would be a good idea?
deferral->Complete();
});
}
void App::OnResuming(Platform::Object^ sender, Platform::Object^ args)
{
// Restore any data or state that was unloaded on suspend. By default, data
// and state are persisted when resuming from suspend. Note that this event
// does not occur if the app was previously terminated.
}
void App::OnBackRequested(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs^ args)
{
/* Prevent the B controller button on Xbox One from quitting the app */
args->Handled = true;
}
// Window event handlers.
void App::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ args)
{
m_windowResized = true;
}
void App::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args)
{
m_windowVisible = args->Visible;
}
void App::OnWindowActivated(CoreWindow^ sender, WindowActivatedEventArgs^ args)
{
m_windowFocused = args->WindowActivationState != CoreWindowActivationState::Deactivated;
}
void App::OnKey(CoreWindow^ sender, KeyEventArgs^ args)
{
uint16_t mod = 0;
if ((sender->GetKeyState(VirtualKey::Shift) & CoreVirtualKeyStates::Locked) == CoreVirtualKeyStates::Locked)
mod |= RETROKMOD_SHIFT;
if ((sender->GetKeyState(VirtualKey::Control) & CoreVirtualKeyStates::Locked) == CoreVirtualKeyStates::Locked)
mod |= RETROKMOD_CTRL;
if ((sender->GetKeyState(VirtualKey::Menu) & CoreVirtualKeyStates::Locked) == CoreVirtualKeyStates::Locked)
mod |= RETROKMOD_ALT;
if ((sender->GetKeyState(VirtualKey::CapitalLock) & CoreVirtualKeyStates::Locked) == CoreVirtualKeyStates::Locked)
mod |= RETROKMOD_CAPSLOCK;
if ((sender->GetKeyState(VirtualKey::Scroll) & CoreVirtualKeyStates::Locked) == CoreVirtualKeyStates::Locked)
mod |= RETROKMOD_SCROLLOCK;
if ((sender->GetKeyState(VirtualKey::LeftWindows) & CoreVirtualKeyStates::Locked) == CoreVirtualKeyStates::Locked ||
(sender->GetKeyState(VirtualKey::RightWindows) & CoreVirtualKeyStates::Locked) == CoreVirtualKeyStates::Locked)
mod |= RETROKMOD_META;
unsigned keycode = input_keymaps_translate_keysym_to_rk((unsigned)args->VirtualKey);
input_keyboard_event(!args->KeyStatus.IsKeyReleased, keycode, 0, mod, RETRO_DEVICE_KEYBOARD);
}
void App::OnPointer(CoreWindow^ sender, PointerEventArgs^ args)
{
if (args->CurrentPoint->PointerDevice->PointerDeviceType == PointerDeviceType::Mouse)
{
uwp_next_input.mouse_left = args->CurrentPoint->Properties->IsLeftButtonPressed;
uwp_next_input.mouse_middle = args->CurrentPoint->Properties->IsMiddleButtonPressed;
uwp_next_input.mouse_right = args->CurrentPoint->Properties->IsRightButtonPressed;
uwp_next_input.mouse_button4 = args->CurrentPoint->Properties->IsXButton1Pressed;
uwp_next_input.mouse_button5 = args->CurrentPoint->Properties->IsXButton2Pressed;
uwp_next_input.mouse_screen_x = args->CurrentPoint->Position.X;
uwp_next_input.mouse_screen_y = args->CurrentPoint->Position.Y;
uwp_next_input.mouse_rel_x = uwp_next_input.mouse_screen_x - uwp_current_input.mouse_screen_x;
uwp_next_input.mouse_rel_y = uwp_next_input.mouse_screen_y - uwp_current_input.mouse_screen_y;
if (args->CurrentPoint->Properties->IsHorizontalMouseWheel)
{
uwp_next_input.mouse_wheel_left += args->CurrentPoint->Properties->MouseWheelDelta;
}
else
{
uwp_next_input.mouse_wheel_up += args->CurrentPoint->Properties->MouseWheelDelta;
}
}
else
{
uwp_next_input.touch_touched = args->CurrentPoint->IsInContact;
uwp_next_input.touch_screen_x = args->CurrentPoint->Position.X;
uwp_next_input.touch_screen_y = args->CurrentPoint->Position.Y;
uwp_next_input.touch_rel_x = uwp_next_input.touch_screen_x - uwp_current_input.touch_screen_x;
uwp_next_input.touch_rel_y = uwp_next_input.touch_screen_y - uwp_current_input.touch_screen_y;
}
}
void App::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args)
{
m_windowClosed = true;
}
// DisplayInformation event handlers.
void App::OnDpiChanged(DisplayInformation^ sender, Object^ args)
{
m_windowResized = true;
}
void App::OnOrientationChanged(DisplayInformation^ sender, Object^ args)
{
m_windowResized = true;
}
void App::OnDisplayContentsInvalidated(DisplayInformation^ sender, Object^ args)
{
// Probably can be ignored?
}
// Taken from DirectX UWP samples - on Xbox, everything is scaled 200% so getting the DPI calculation correct is crucial
static inline float ConvertDipsToPixels(float dips, float dpi)
{
static const float dipsPerInch = 96.0f;
return floorf(dips * dpi / dipsPerInch + 0.5f);
}
// Implement UWP equivalents of various win32_* functions
extern "C" {
bool win32_has_focus(void)
{
return App::GetInstance()->IsWindowFocused();
}
bool win32_set_video_mode(void *data, unsigned width, unsigned height, bool fullscreen)
{
if (App::GetInstance()->IsInitialized())
{
if (fullscreen != ApplicationView::GetForCurrentView()->IsFullScreenMode)
{
if (fullscreen)
ApplicationView::GetForCurrentView()->TryEnterFullScreenMode();
else
ApplicationView::GetForCurrentView()->ExitFullScreenMode();
}
ApplicationView::GetForCurrentView()->TryResizeView(Size(width, height));
}
else
{
/* In case the window is not activated yet, TryResizeView will fail and we have to set the initial parameters instead */
/* Note that these are preserved after restarting the app and used for the UWP splash screen size (!), so they should be set only during init and not changed afterwards */
ApplicationView::PreferredLaunchViewSize = Size(width, height);
ApplicationView::PreferredLaunchWindowingMode = fullscreen ? ApplicationViewWindowingMode::FullScreen : ApplicationViewWindowingMode::PreferredLaunchViewSize;
}
/* Setting the window size may sometimes fail "because UWP"
* (i.e. we are on device with no windows, or Windows sandbox decides the window can't be that small)
* so in case resizing fails we just send a resized event back to RetroArch with old size
* (and report success because otherwise it bails out hard about failing to set video mode)
*/
App::GetInstance()->SetWindowResized();
return true;
}
void win32_show_cursor(bool state)
{
CoreWindow::GetForCurrentThread()->PointerCursor = state ? ref new CoreCursor(CoreCursorType::Arrow, 0) : nullptr;
}
void win32_check_window(bool *quit, bool *resize, unsigned *width, unsigned *height)
{
*quit = App::GetInstance()->IsWindowClosed();
*resize = App::GetInstance()->CheckWindowResized();
if (*resize)
{
float dpi = DisplayInformation::GetForCurrentView()->LogicalDpi;
*width = ConvertDipsToPixels(CoreWindow::GetForCurrentThread()->Bounds.Width, dpi);
*height = ConvertDipsToPixels(CoreWindow::GetForCurrentThread()->Bounds.Height, dpi);
}
}
void* uwp_get_corewindow(void)
{
return (void*)CoreWindow::GetForCurrentThread();
}
void uwp_input_next_frame(void)
{
uwp_current_input = uwp_next_input;
uwp_next_input.mouse_rel_x = 0;
uwp_next_input.mouse_rel_y = 0;
uwp_next_input.mouse_wheel_up %= WHEEL_DELTA;
uwp_next_input.mouse_wheel_left %= WHEEL_DELTA;
uwp_next_input.touch_rel_x = 0;
uwp_next_input.touch_rel_y = 0;
}
bool uwp_keyboard_pressed(unsigned key)
{
unsigned sym = rarch_keysym_lut[(enum retro_key)key];
return (CoreWindow::GetForCurrentThread()->GetKeyState((VirtualKey)sym) & CoreVirtualKeyStates::Down) == CoreVirtualKeyStates::Down;
}
int16_t uwp_mouse_state(unsigned port, unsigned id, bool screen)
{
int16_t state = 0;
switch (id)
{
case RETRO_DEVICE_ID_MOUSE_X:
return screen ? uwp_current_input.mouse_screen_x : uwp_current_input.mouse_rel_x;
case RETRO_DEVICE_ID_MOUSE_Y:
return screen ? uwp_current_input.mouse_screen_y : uwp_current_input.mouse_rel_y;
case RETRO_DEVICE_ID_MOUSE_LEFT:
return uwp_current_input.mouse_left;
case RETRO_DEVICE_ID_MOUSE_RIGHT:
return uwp_current_input.mouse_right;
case RETRO_DEVICE_ID_MOUSE_WHEELUP:
return uwp_current_input.mouse_wheel_up > WHEEL_DELTA;
case RETRO_DEVICE_ID_MOUSE_WHEELDOWN:
return uwp_current_input.mouse_wheel_up < -WHEEL_DELTA;
case RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELUP:
return uwp_current_input.mouse_wheel_left > WHEEL_DELTA;
case RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELDOWN:
return uwp_current_input.mouse_wheel_left < -WHEEL_DELTA;
case RETRO_DEVICE_ID_MOUSE_MIDDLE:
return uwp_current_input.mouse_middle;
case RETRO_DEVICE_ID_MOUSE_BUTTON_4:
return uwp_current_input.mouse_button4;
case RETRO_DEVICE_ID_MOUSE_BUTTON_5:
return uwp_current_input.mouse_button5;
}
return 0;
}
// TODO: I don't have any touch-enabled Windows devices to test if this actually works
int16_t uwp_pointer_state(unsigned idx, unsigned id, bool screen)
{
switch (id)
{
case RETRO_DEVICE_ID_POINTER_X:
return screen ? uwp_current_input.touch_screen_x : uwp_current_input.touch_rel_x;
case RETRO_DEVICE_ID_POINTER_Y:
return screen ? uwp_current_input.touch_screen_y : uwp_current_input.touch_rel_y;
case RETRO_DEVICE_ID_POINTER_PRESSED:
return uwp_current_input.touch_touched;
default:
break;
}
return 0;
}
}

79
uwp/uwp_main.h Normal file
View File

@ -0,0 +1,79 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2018 - Krzysztof Haładyn
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "uwp_main.h"
namespace RetroArchUWP
{
// Main entry point for our app. Connects the app with the Windows shell and handles application lifecycle events.
ref class App sealed : public Windows::ApplicationModel::Core::IFrameworkView
{
public:
App();
// IFrameworkView methods.
virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
virtual void Load(Platform::String^ entryPoint);
virtual void Run();
virtual void Uninitialize();
protected:
// Application lifecycle event handlers.
void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
void OnResuming(Platform::Object^ sender, Platform::Object^ args);
void OnBackRequested(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs^ args);
// Window event handlers.
void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
void OnWindowActivated(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowActivatedEventArgs^ args);
void OnKey(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
void OnPointer(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
// DisplayInformation event handlers.
void OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
void OnDisplayContentsInvalidated(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
public:
bool IsInitialized() { return m_initialized; }
bool IsWindowClosed() { return m_windowClosed; }
bool IsWindowVisible() { return m_windowVisible; }
bool IsWindowFocused() { return m_windowFocused; }
bool CheckWindowResized() { bool resized = m_windowResized; m_windowResized = false; return resized; }
void SetWindowResized() { m_windowResized = true; }
static App^ GetInstance() { return m_instance; }
private:
bool m_initialized;
bool m_windowClosed;
bool m_windowVisible;
bool m_windowFocused;
bool m_windowResized;
static App^ m_instance;
};
}
ref class Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
{
public:
virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
};

View File

@ -37,6 +37,11 @@
#include <android/log.h>
#endif
#if _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#include <string/stdstring.h>
#include <streams/file_stream.h>
#include <compat/fopen_utf8.h>
@ -60,7 +65,11 @@
* will write to this file. */
static FILE *log_file_fp = NULL;
static void* log_file_buf = NULL;
#if _DEBUG
static bool main_verbosity = true;
#else
static bool main_verbosity = false;
#endif
static bool log_file_initialized = false;
#ifdef NXLINK
@ -193,7 +202,7 @@ void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
#else
{
#ifdef HAVE_QT
#if defined(HAVE_QT) || defined(__WINRT__)
char buffer[1024];
#endif
#ifdef HAVE_FILE_LOGGER
@ -202,7 +211,7 @@ void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
FILE *fp = stderr;
#endif
#ifdef HAVE_QT
#if defined(HAVE_QT) || defined(__WINRT__)
buffer[0] = '\0';
vsnprintf(buffer, sizeof(buffer), fmt, ap);
@ -212,7 +221,13 @@ void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
fflush(fp);
}
#if defined(HAVE_QT)
ui_companion_driver_log_msg(buffer);
#endif
#if defined(__WINRT__)
OutputDebugStringA(buffer);
#endif
#else
#if defined(NXLINK) && !defined(HAVE_FILE_LOGGER)
if (nxlink_connected)