Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Rubberduckycooly
GitHub Repository: Rubberduckycooly/RSDKv5-Decompilation
Path: blob/master/RSDKv5/RSDK/Graphics/EGL/EGLRenderDevice.hpp
1175 views
1
class RenderDevice : public RenderDeviceBase
2
{
3
public:
4
struct WindowInfo {
5
// WindowInfo mad useless in EGL so we cheat
6
typedef struct {
7
uint32 width;
8
uint32 height;
9
uint32 refresh_rate;
10
} BasicWindowInfo;
11
union {
12
struct {
13
uint32 width;
14
uint32 height;
15
uint32 refresh_rate;
16
};
17
BasicWindowInfo internal;
18
} * displays;
19
};
20
21
static WindowInfo displayInfo;
22
23
static bool Init();
24
static void CopyFrameBuffer();
25
static void FlipScreen();
26
static void Release(bool32 isRefresh);
27
28
static void RefreshWindow();
29
static void GetWindowSize(int32 *width, int32 *height);
30
31
static void SetupImageTexture(int32 width, int32 height, uint8 *imagePixels);
32
static void SetupVideoTexture_YUV420(int32 width, int32 height, uint8 *yPlane, uint8 *uPlane, uint8 *vPlane, int32 strideY, int32 strideU,
33
int32 strideV);
34
static void SetupVideoTexture_YUV422(int32 width, int32 height, uint8 *yPlane, uint8 *uPlane, uint8 *vPlane, int32 strideY, int32 strideU,
35
int32 strideV);
36
static void SetupVideoTexture_YUV444(int32 width, int32 height, uint8 *yPlane, uint8 *uPlane, uint8 *vPlane, int32 strideY, int32 strideU,
37
int32 strideV);
38
39
static bool ProcessEvents();
40
41
static void InitFPSCap();
42
static bool CheckFPSCap();
43
static void UpdateFPSCap();
44
45
static bool InitShaders();
46
static void LoadShader(const char *fileName, bool32 linear);
47
48
static inline void ShowCursor(bool32 shown) {}
49
static inline bool GetCursorPos(Vector2 *pos) { return false; }
50
static inline void SetWindowTitle() {}
51
52
static EGLDisplay display;
53
static EGLContext context;
54
static EGLSurface surface;
55
static EGLConfig config;
56
57
#if RETRO_PLATFORM == RETRO_SWITCH
58
static NWindow *window;
59
#elif RETRO_PLATFORM == RETRO_ANDROID
60
static ANativeWindow *window;
61
#endif
62
63
static GLuint screenTextures[SCREEN_COUNT];
64
static GLuint imageTexture;
65
66
static bool32 isInitialized;
67
68
private:
69
static bool SetupRendering();
70
static void InitVertexBuffer();
71
static bool InitGraphicsAPI();
72
73
static void GetDisplays();
74
75
static void SetLinear(bool32 linear);
76
77
static int32 monitorIndex;
78
79
static GLuint VAO;
80
static GLuint VBO;
81
82
static uint32 *videoBuffer;
83
};
84
85
struct ShaderEntry : public ShaderEntryBase {
86
GLuint programID;
87
};
88
89