-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6292 from smoogipoo/bring-back-sdl2
Bring back SDL2 by default, lock SDL3 behind environment variable
- Loading branch information
Showing
56 changed files
with
5,104 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using System.Drawing; | ||
using osu.Framework.Bindables; | ||
using osu.Framework.Input; | ||
using osuTK; | ||
using osuTK.Input; | ||
using RectangleF = osu.Framework.Graphics.Primitives.RectangleF; | ||
|
||
namespace osu.Framework.Platform | ||
{ | ||
internal interface ISDLWindow : IWindow | ||
{ | ||
event Action<JoystickButton> JoystickButtonDown; | ||
event Action<JoystickButton> JoystickButtonUp; | ||
event Action<JoystickAxisSource, float> JoystickAxisChanged; | ||
event Action<Touch> TouchDown; | ||
event Action<Touch> TouchUp; | ||
event Action<Vector2> MouseMove; | ||
event Action<Vector2> MouseMoveRelative; | ||
event Action<MouseButton> MouseDown; | ||
event Action<MouseButton> MouseUp; | ||
event Action<Vector2, bool> MouseWheel; | ||
event Action<Key> KeyDown; | ||
event Action<Key> KeyUp; | ||
event Action<string> TextInput; | ||
event TextEditingDelegate TextEditing; | ||
event Action<WindowState> WindowStateChanged; | ||
|
||
Bindable<CursorState> CursorStateBindable { get; } | ||
|
||
Point Position { get; } | ||
Size Size { get; } | ||
float Scale { get; } | ||
bool Resizable { get; set; } | ||
|
||
bool MouseAutoCapture { set; } | ||
bool RelativeMouseMode { get; set; } | ||
bool CapsLockPressed { get; } | ||
|
||
void UpdateMousePosition(Vector2 position); | ||
|
||
void StartTextInput(bool allowIme); | ||
void StopTextInput(); | ||
void SetTextInputRect(RectangleF rectangle); | ||
void ResetIme(); | ||
} | ||
|
||
/// <summary> | ||
/// Fired when text is edited, usually via IME composition. | ||
/// </summary> | ||
/// <param name="text">The composition text.</param> | ||
/// <param name="start">The index of the selection start.</param> | ||
/// <param name="length">The length of the selection.</param> | ||
public delegate void TextEditingDelegate(string text, int start, int length); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Framework.Platform.SDL2; | ||
using static SDL2.SDL; | ||
|
||
namespace osu.Framework.Platform.Linux | ||
{ | ||
internal class SDL2LinuxWindow : SDL2DesktopWindow | ||
{ | ||
public SDL2LinuxWindow(GraphicsSurfaceType surfaceType, string appName, bool bypassCompositor) | ||
: base(surfaceType, appName) | ||
{ | ||
SDL_SetHint(SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, bypassCompositor ? "1" : "0"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Framework.Platform.SDL3; | ||
using static SDL.SDL3; | ||
|
||
namespace osu.Framework.Platform.Linux | ||
{ | ||
internal class SDL3LinuxWindow : SDL3DesktopWindow | ||
{ | ||
public SDL3LinuxWindow(GraphicsSurfaceType surfaceType, string appName, bool bypassCompositor) | ||
: base(surfaceType, appName) | ||
{ | ||
SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, bypassCompositor ? "1"u8 : "0"u8); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.