mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-10 05:34:17 +00:00
6f39d120cb
SDL may not be able to give us a DRM FD for Vulkan windows.
45 lines
943 B
C++
45 lines
943 B
C++
#pragma once
|
|
|
|
#include <SDL.h>
|
|
|
|
// SDL_FRect wasn't added until 2.0.10
|
|
#if !SDL_VERSION_ATLEAST(2, 0, 10)
|
|
typedef struct SDL_FRect
|
|
{
|
|
float x;
|
|
float y;
|
|
float w;
|
|
float h;
|
|
} SDL_FRect;
|
|
#endif
|
|
|
|
class StreamUtils
|
|
{
|
|
public:
|
|
static
|
|
Uint32 getPlatformWindowFlags();
|
|
|
|
static
|
|
void scaleSourceToDestinationSurface(SDL_Rect* src, SDL_Rect* dst);
|
|
|
|
static
|
|
void screenSpaceToNormalizedDeviceCoords(SDL_FRect* rect, int viewportWidth, int viewportHeight);
|
|
|
|
static
|
|
void screenSpaceToNormalizedDeviceCoords(SDL_Rect* src, SDL_FRect* dst, int viewportWidth, int viewportHeight);
|
|
|
|
static
|
|
bool getNativeDesktopMode(int displayIndex, SDL_DisplayMode* mode, SDL_Rect* safeArea);
|
|
|
|
static
|
|
int getDisplayRefreshRate(SDL_Window* window);
|
|
|
|
static
|
|
bool hasFastAes();
|
|
|
|
static
|
|
int getDrmFdForWindow(SDL_Window* window, bool* needsClose);
|
|
|
|
static
|
|
int getDrmFd(bool preferRenderNode);
|
|
};
|