Path: blob/master/RSDKv5/RSDK/Graphics/SDL2/SDL2RenderDevice.hpp
1168 views
using ShaderEntry = ShaderEntryBase;12class RenderDevice : public RenderDeviceBase3{4public:5struct WindowInfo {6union {7struct {8// i wanna do uint32 : 32 but idk if other compilers like that9uint32 _pad;10int32 width;11int32 height;12int32 refresh_rate;13};14SDL_DisplayMode internal;15} * displays;16SDL_Rect viewport;17};18static WindowInfo displayInfo;1920static bool Init();21static void CopyFrameBuffer();22static void FlipScreen();23static void Release(bool32 isRefresh);2425static void RefreshWindow();26static void GetWindowSize(int32 *width, int32 *height);2728static void SetupImageTexture(int32 width, int32 height, uint8 *imagePixels);29static void SetupVideoTexture_YUV420(int32 width, int32 height, uint8 *yPlane, uint8 *uPlane, uint8 *vPlane, int32 strideY, int32 strideU,30int32 strideV);31static void SetupVideoTexture_YUV422(int32 width, int32 height, uint8 *yPlane, uint8 *uPlane, uint8 *vPlane, int32 strideY, int32 strideU,32int32 strideV);33static void SetupVideoTexture_YUV444(int32 width, int32 height, uint8 *yPlane, uint8 *uPlane, uint8 *vPlane, int32 strideY, int32 strideU,34int32 strideV);3536static bool ProcessEvents();3738static void InitFPSCap();39static bool CheckFPSCap();40static void UpdateFPSCap();4142static bool InitShaders();43static void LoadShader(const char *fileName, bool32 linear);4445static inline void ShowCursor(bool32 shown) { SDL_ShowCursor(shown); }46static inline bool GetCursorPos(Vector2 *pos)47{48SDL_GetMouseState(&pos->x, &pos->y);49return true;50};5152static inline void SetWindowTitle() { SDL_SetWindowTitle(window, gameVerInfo.gameTitle); };5354static SDL_Window *window;55static SDL_Renderer *renderer;56static SDL_Texture *screenTexture[SCREEN_COUNT];5758static SDL_Texture *imageTexture;5960private:61static bool SetupRendering();62static void InitVertexBuffer();63static bool InitGraphicsAPI();6465static void GetDisplays();6667static void ProcessEvent(SDL_Event event);6869static uint32 displayModeIndex;70static int32 displayModeCount;7172static unsigned long long targetFreq;73static unsigned long long curTicks;74static unsigned long long prevTicks;7576static RenderVertex vertexBuffer[!RETRO_REV02 ? 24 : 60];7778// thingo majigo for handling video/image swapping79static uint8 lastTextureFormat;80};818283