2019-12-11 00:51:42 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
2019-12-23 17:43:10 -05:00
|
|
|
#include "GpPixelFormat.h"
|
2019-12-22 00:35:30 -05:00
|
|
|
#include "EGpStandardCursor.h"
|
2019-12-21 18:40:17 -05:00
|
|
|
|
|
|
|
|
struct IGpDisplayDriverSurface;
|
2020-02-23 20:21:04 -05:00
|
|
|
struct IGpCursor;
|
2020-06-13 04:33:41 -04:00
|
|
|
struct GpDisplayDriverProperties;
|
2019-12-21 18:40:17 -05:00
|
|
|
|
2020-05-18 02:03:17 -04:00
|
|
|
struct GpDisplayDriverSurfaceEffects
|
|
|
|
|
{
|
|
|
|
|
GpDisplayDriverSurfaceEffects();
|
|
|
|
|
|
|
|
|
|
bool m_darken;
|
2020-05-18 03:30:25 -04:00
|
|
|
bool m_flicker;
|
|
|
|
|
int32_t m_flickerAxisX;
|
|
|
|
|
int32_t m_flickerAxisY;
|
|
|
|
|
int32_t m_flickerStartThreshold;
|
|
|
|
|
int32_t m_flickerEndThreshold;
|
2020-05-22 21:14:43 -04:00
|
|
|
float m_desaturation;
|
2020-05-18 02:03:17 -04:00
|
|
|
};
|
|
|
|
|
|
2019-12-21 18:40:17 -05:00
|
|
|
// Display drivers are responsible for timing and calling the game tick function.
|
|
|
|
|
struct IGpDisplayDriver
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual void Run() = 0;
|
|
|
|
|
virtual void Shutdown() = 0;
|
|
|
|
|
|
2020-06-13 04:33:41 -04:00
|
|
|
virtual void GetDisplayResolution(unsigned int *width, unsigned int *height) = 0;
|
2019-12-21 18:40:17 -05:00
|
|
|
|
2019-12-23 17:43:10 -05:00
|
|
|
virtual IGpDisplayDriverSurface *CreateSurface(size_t width, size_t height, GpPixelFormat_t pixelFormat) = 0;
|
2020-05-18 02:03:17 -04:00
|
|
|
virtual void DrawSurface(IGpDisplayDriverSurface *surface, int32_t x, int32_t y, size_t width, size_t height, const GpDisplayDriverSurfaceEffects *effects) = 0;
|
2019-12-21 18:40:17 -05:00
|
|
|
|
2020-02-23 20:21:04 -05:00
|
|
|
virtual IGpCursor *LoadCursor(bool isColor, int cursorID) = 0;
|
|
|
|
|
virtual void SetCursor(IGpCursor *cursor) = 0;
|
2019-12-22 00:35:30 -05:00
|
|
|
virtual void SetStandardCursor(EGpStandardCursor_t standardCursor) = 0;
|
|
|
|
|
|
2019-12-21 18:40:17 -05:00
|
|
|
virtual void UpdatePalette(const void *paletteData) = 0;
|
2020-04-05 02:15:49 -04:00
|
|
|
|
|
|
|
|
virtual void SetBackgroundColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a) = 0;
|
2020-04-18 00:18:20 -04:00
|
|
|
|
|
|
|
|
virtual void RequestToggleFullScreen(uint32_t timestamp) = 0;
|
2020-06-20 01:33:26 -04:00
|
|
|
virtual void RequestResetVirtualResolution() = 0;
|
2020-06-13 04:33:41 -04:00
|
|
|
|
|
|
|
|
virtual const GpDisplayDriverProperties &GetProperties() const = 0;
|
2019-12-21 18:40:17 -05:00
|
|
|
};
|
2020-05-18 02:03:17 -04:00
|
|
|
|
|
|
|
|
inline GpDisplayDriverSurfaceEffects::GpDisplayDriverSurfaceEffects()
|
|
|
|
|
: m_darken(false)
|
2020-05-18 03:30:25 -04:00
|
|
|
, m_flicker(false)
|
|
|
|
|
, m_flickerAxisX(0)
|
|
|
|
|
, m_flickerAxisY(0)
|
|
|
|
|
, m_flickerStartThreshold(0)
|
|
|
|
|
, m_flickerEndThreshold(0)
|
2020-05-22 21:14:43 -04:00
|
|
|
, m_desaturation(0)
|
2020-05-18 03:30:25 -04:00
|
|
|
{
|
2020-05-18 02:03:17 -04:00
|
|
|
}
|