2019-12-11 00:51:42 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
2019-12-31 05:20:07 -05:00
|
|
|
#include "GpDisplayDriverTickStatus.h"
|
2019-12-21 18:40:17 -05:00
|
|
|
#include "GpVOSEventQueue.h"
|
2019-12-11 00:51:42 -05:00
|
|
|
#include "HostSuspendCallID.h"
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
namespace PortabilityLayer
|
|
|
|
|
{
|
|
|
|
|
union HostSuspendCallArgument;
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-21 18:40:17 -05:00
|
|
|
struct IGpDisplayDriver;
|
|
|
|
|
struct IGpAudioDriver;
|
2019-12-23 17:43:10 -05:00
|
|
|
struct IGpFiber;
|
2020-09-12 14:01:51 -04:00
|
|
|
struct IGpFontHandler;
|
2020-11-25 12:05:59 -05:00
|
|
|
struct IGpInputDriver;
|
|
|
|
|
struct IGpSystemServices;
|
|
|
|
|
struct IGpVOSEventQueue;
|
2019-12-11 00:51:42 -05:00
|
|
|
|
|
|
|
|
class GpAppEnvironment
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
GpAppEnvironment();
|
|
|
|
|
~GpAppEnvironment();
|
|
|
|
|
|
|
|
|
|
void Init();
|
2021-03-26 17:05:38 -04:00
|
|
|
void Run();
|
2019-12-11 00:51:42 -05:00
|
|
|
|
2019-12-21 18:40:17 -05:00
|
|
|
void Render();
|
2020-04-18 00:18:20 -04:00
|
|
|
bool AdjustRequestedResolution(uint32_t &physicalWidth, uint32_t &physicalHeight, uint32_t &virtualWidth, uint32_t &virtualheight, float &pixelScaleX, float &pixelScaleY);
|
2019-12-21 18:40:17 -05:00
|
|
|
|
2019-12-11 00:51:42 -05:00
|
|
|
void SetDisplayDriver(IGpDisplayDriver *displayDriver);
|
|
|
|
|
void SetAudioDriver(IGpAudioDriver *audioDriver);
|
2019-12-29 17:39:19 -05:00
|
|
|
void SetInputDrivers(IGpInputDriver *const* inputDrivers, size_t numDrivers);
|
2020-09-12 14:01:51 -04:00
|
|
|
void SetFontHandler(IGpFontHandler *fontHandler);
|
2019-12-24 02:35:24 -05:00
|
|
|
void SetVOSEventQueue(GpVOSEventQueue *eventQueue);
|
2020-11-25 12:05:59 -05:00
|
|
|
void SetSystemServices(IGpSystemServices *systemServices);
|
2019-12-11 00:51:42 -05:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
static void StaticAppThreadFunc(void *context);
|
|
|
|
|
void InitializeApplicationState();
|
|
|
|
|
|
|
|
|
|
IGpDisplayDriver *m_displayDriver;
|
|
|
|
|
IGpAudioDriver *m_audioDriver;
|
2019-12-29 17:39:19 -05:00
|
|
|
IGpInputDriver *const* m_inputDrivers;
|
2020-09-12 14:01:51 -04:00
|
|
|
IGpFontHandler *m_fontHandler;
|
2019-12-24 02:35:24 -05:00
|
|
|
GpVOSEventQueue *m_vosEventQueue;
|
2020-11-25 12:05:59 -05:00
|
|
|
IGpSystemServices *m_systemServices;
|
2019-12-11 00:51:42 -05:00
|
|
|
|
|
|
|
|
uint32_t m_delaySuspendTicks;
|
2019-12-29 17:39:19 -05:00
|
|
|
size_t m_numInputDrivers;
|
2019-12-11 00:51:42 -05:00
|
|
|
|
|
|
|
|
PortabilityLayer::HostSuspendCallID m_suspendCallID;
|
|
|
|
|
const PortabilityLayer::HostSuspendCallArgument *m_suspendArgs;
|
|
|
|
|
PortabilityLayer::HostSuspendCallArgument *m_suspendReturnValue;
|
|
|
|
|
};
|