1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/********************************************************************
*
*	File:		fsCHardware.h
*
*	Purpose:	bgfx (GLFW-hosted) implementation.
*
*********************************************************************/

#ifndef fsCHardwarehdr
#define fsCHardwarehdr

#include "../../fsIHardware.h"

#if defined fsDesktop
struct GLFWwindow;
struct GLFWcursor;
struct GLFWvidmode;
#endif

class fsCHardware : public fsIHardware
{
public:

#if defined fsDesktop
	void hardwareCursorInit() override;
	void hardwareCursorUninit() override;
	void hardwareCursorChange(const fsStr& pID) override;
	void windowedDisplayModesEnumerate(fsDisplayInfo*& pAvailableModeList, fsS32& pNumModesInList) override;
	void appMinimize() override;
	void appMaximize() override;
	void appHideEnable() override;<--- Function in derived class
#endif

	void hardwareCursorEnabledSet(fsBool pEnabled) const override;
	void hardwareCursorSet(const fsCResourceName& pFilename, fsBool pFlipped) override;<--- Function in derived class

	void timeScaleSet(fsF32 pScale) override;
	void engineCacheFlush() const override;<--- Function in derived class

	fsU64 utcTimeGet() const override;

	ePlatform platformGet() const override;

	fsBool smallDeviceGet() const override;

	fsStr sdkVersionStringGet() const override;

	fsStr appDataFolderGet() const override;

	fsBool multipleAppInstances() const override;
	fsBool processRunning(const fsStr& pProcessName) const override;

	fsBool windowedModePossibleGet() const override;

	void browserLaunch(const fsStr& pUrl) const override;

	fsCHardware();
	virtual ~fsCHardware();<--- Destructor in derived class

protected:

#if defined fsDesktop
	void wallpaperApplyDo(const fsCResourceName& pWallpaper) override;
#endif

	void updateDo(fsS32 pDeltaMs) override;<--- Function in derived class
	void rndSeedDo() const override;

private:

#if defined fsPCStore
	fsBool mCursorInClientArea;
#endif

#if defined fsDesktop

	static void enterEvent(GLFWwindow* window, int entered);

	void cursorApply();
	void cursorCreate(fsStr const& pFilename, fsBool pFlipped);
	void cursorClear();

	GLFWcursor* mCursor = nullptr;

	fsS32 mWindowWWidth;
	fsS32 mWindowHeight;
	fsBool mWindowFullscreen;

#endif
};

#endif