Prepare for SDL3 support

This commit is contained in:
Cameron Gutman
2025-01-25 16:18:45 -06:00
parent edd7a134d8
commit dd2a99a96b
25 changed files with 101 additions and 47 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include "renderer.h"
#include <SDL.h>
#include "SDL_compat.h"
class SdlAudioRenderer : public IAudioRenderer
{
-1
View File
@@ -1,7 +1,6 @@
#include "sdl.h"
#include <Limelight.h>
#include <SDL.h>
SdlAudioRenderer::SdlAudioRenderer()
: m_AudioDevice(0),
+1 -1
View File
@@ -1,6 +1,6 @@
#include "slaud.h"
#include <SDL.h>
#include "SDL_compat.h"
SLAudioRenderer::SLAudioRenderer()
: m_AudioContext(nullptr),
@@ -1,6 +1,6 @@
#include "soundioaudiorenderer.h"
#include <SDL.h>
#include "SDL_compat.h"
#include <QtGlobal>
+1 -1
View File
@@ -1,7 +1,7 @@
#include "input.h"
#include <Limelight.h>
#include <SDL.h>
#include "SDL_compat.h"
#include <SDL_syswm.h>
#include "streaming/streamutils.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#include "streaming/session.h"
#include <Limelight.h>
#include <SDL.h>
#include "SDL_compat.h"
#include "settings/mappingmanager.h"
#include <QtMath>
+4 -4
View File
@@ -1,5 +1,5 @@
#include <Limelight.h>
#include <SDL.h>
#include "SDL_compat.h"
#include "streaming/session.h"
#include "settings/mappingmanager.h"
#include "path.h"
@@ -50,7 +50,7 @@ SdlInputHandler::SdlInputHandler(StreamingPreferences& prefs, int streamWidth, i
#endif
// Opt-out of SDL's built-in Alt+Tab handling while keyboard grab is enabled
SDL_SetHint("SDL_ALLOW_ALT_TAB_WHILE_GRABBED", "0");
SDL_SetHint(SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED, "0");
// Allow clicks to pass through to us when focusing the window. If we're in
// absolute mouse mode, this will avoid the user having to click twice to
@@ -62,8 +62,8 @@ SdlInputHandler::SdlInputHandler(StreamingPreferences& prefs, int streamWidth, i
// controllers, but breaks DirectInput applications. We will enable it because
// it's likely that working rumble is what the user is expecting. If they don't
// want this behavior, they can override it with the environment variable.
SDL_SetHint("SDL_JOYSTICK_HIDAPI_PS4_RUMBLE", "1");
SDL_SetHint("SDL_JOYSTICK_HIDAPI_PS5_RUMBLE", "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1");
// Populate special key combo configuration
m_SpecialKeyCombos[KeyComboQuit].keyCombo = KeyComboQuit;
+1 -1
View File
@@ -3,7 +3,7 @@
#include "settings/streamingpreferences.h"
#include "backend/computermanager.h"
#include <SDL.h>
#include "SDL_compat.h"
struct GamepadState {
SDL_GameController* controller;
+1 -1
View File
@@ -1,7 +1,7 @@
#include "streaming/session.h"
#include <Limelight.h>
#include <SDL.h>
#include "SDL_compat.h"
#define VK_0 0x30
#define VK_A 0x41
+1 -1
View File
@@ -1,7 +1,7 @@
#include "input.h"
#include <Limelight.h>
#include <SDL.h>
#include "SDL_compat.h"
#include "streaming/streamutils.h"
void SdlInputHandler::handleMouseButtonEvent(SDL_MouseButtonEvent* event)
+1 -1
View File
@@ -1,7 +1,7 @@
#include "input.h"
#include <Limelight.h>
#include <SDL.h>
#include "SDL_compat.h"
#include <QtMath>
+1 -1
View File
@@ -4,7 +4,7 @@
#include "backend/richpresencemanager.h"
#include <Limelight.h>
#include <SDL.h>
#include "SDL_compat.h"
#include "utils.h"
#ifdef HAVE_FFMPEG
+1 -12
View File
@@ -1,17 +1,6 @@
#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
#include "SDL_compat.h"
class StreamUtils
{
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include <Limelight.h>
#include <SDL.h>
#include "SDL_compat.h"
#include "settings/streamingpreferences.h"
#define SDL_CODE_FRAME_READY 0
@@ -647,14 +647,12 @@ bool EGLRenderer::initialize(PDECODER_PARAMETERS params)
// Detach the context from this thread, so the render thread can attach it
SDL_GL_MakeCurrent(m_Window, nullptr);
#ifdef SDL_HINT_VIDEO_X11_FORCE_EGL
if (err == GL_NO_ERROR) {
// If we got a working GL implementation via EGL, avoid using GLX from now on.
// GLX will cause problems if we later want to use EGL again on this window.
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "EGL passed preflight checks. Using EGL for GL context creation.");
SDL_SetHint(SDL_HINT_VIDEO_X11_FORCE_EGL, "1");
}
#endif
return err == GL_NO_ERROR;
}
@@ -1,6 +1,6 @@
#pragma once
#include <SDL.h>
#include "SDL_compat.h"
#include "streaming/video/decoder.h"
#include "streaming/video/overlaymanager.h"
+1 -1
View File
@@ -2,7 +2,7 @@
#include <QString>
#include <SDL.h>
#include "SDL_compat.h"
#include <SDL_ttf.h>
namespace Overlay {