Path: blob/master/RSDKv5/RSDK/Graphics/EGL/EGLRenderDevice.hpp
1175 views
class RenderDevice : public RenderDeviceBase1{2public:3struct WindowInfo {4// WindowInfo mad useless in EGL so we cheat5typedef struct {6uint32 width;7uint32 height;8uint32 refresh_rate;9} BasicWindowInfo;10union {11struct {12uint32 width;13uint32 height;14uint32 refresh_rate;15};16BasicWindowInfo internal;17} * displays;18};1920static WindowInfo displayInfo;2122static bool Init();23static void CopyFrameBuffer();24static void FlipScreen();25static void Release(bool32 isRefresh);2627static void RefreshWindow();28static void GetWindowSize(int32 *width, int32 *height);2930static void SetupImageTexture(int32 width, int32 height, uint8 *imagePixels);31static void SetupVideoTexture_YUV420(int32 width, int32 height, uint8 *yPlane, uint8 *uPlane, uint8 *vPlane, int32 strideY, int32 strideU,32int32 strideV);33static void SetupVideoTexture_YUV422(int32 width, int32 height, uint8 *yPlane, uint8 *uPlane, uint8 *vPlane, int32 strideY, int32 strideU,34int32 strideV);35static void SetupVideoTexture_YUV444(int32 width, int32 height, uint8 *yPlane, uint8 *uPlane, uint8 *vPlane, int32 strideY, int32 strideU,36int32 strideV);3738static bool ProcessEvents();3940static void InitFPSCap();41static bool CheckFPSCap();42static void UpdateFPSCap();4344static bool InitShaders();45static void LoadShader(const char *fileName, bool32 linear);4647static inline void ShowCursor(bool32 shown) {}48static inline bool GetCursorPos(Vector2 *pos) { return false; }49static inline void SetWindowTitle() {}5051static EGLDisplay display;52static EGLContext context;53static EGLSurface surface;54static EGLConfig config;5556#if RETRO_PLATFORM == RETRO_SWITCH57static NWindow *window;58#elif RETRO_PLATFORM == RETRO_ANDROID59static ANativeWindow *window;60#endif6162static GLuint screenTextures[SCREEN_COUNT];63static GLuint imageTexture;6465static bool32 isInitialized;6667private:68static bool SetupRendering();69static void InitVertexBuffer();70static bool InitGraphicsAPI();7172static void GetDisplays();7374static void SetLinear(bool32 linear);7576static int32 monitorIndex;7778static GLuint VAO;79static GLuint VBO;8081static uint32 *videoBuffer;82};8384struct ShaderEntry : public ShaderEntryBase {85GLuint programID;86};878889