Files
Aerofoil/GpShell/GpAppEnvironment.h

60 lines
1.6 KiB
C
Raw Normal View History

#pragma once
2019-12-31 05:20:07 -05:00
#include "GpDisplayDriverTickStatus.h"
2019-12-21 18:40:17 -05:00
#include "GpVOSEventQueue.h"
#include "HostSuspendCallID.h"
#include <stdint.h>
namespace PortabilityLayer
{
union HostSuspendCallArgument;
}
2019-12-21 18:40:17 -05:00
struct IGpDisplayDriver;
struct IGpAudioDriver;
struct IGpFiber;
2020-09-12 14:01:51 -04:00
struct IGpFontHandler;
struct IGpInputDriver;
struct IGpSystemServices;
struct IGpVOSEventQueue;
class GpAppEnvironment
{
public:
GpAppEnvironment();
~GpAppEnvironment();
void Init();
2021-03-26 17:05:38 -04:00
void Run();
2019-12-21 18:40:17 -05:00
void Render();
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
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);
void SetSystemServices(IGpSystemServices *systemServices);
private:
static void StaticAppThreadFunc(void *context);
void InitializeApplicationState();
void SynchronizeState();
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;
IGpSystemServices *m_systemServices;
uint32_t m_delaySuspendTicks;
2019-12-29 17:39:19 -05:00
size_t m_numInputDrivers;
PortabilityLayer::HostSuspendCallID m_suspendCallID;
const PortabilityLayer::HostSuspendCallArgument *m_suspendArgs;
PortabilityLayer::HostSuspendCallArgument *m_suspendReturnValue;
};