Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
392703f
Convert SDL2 usages to `using static`
Susko3 Mar 3, 2024
dc7ce4e
Run SDL `build-scripits/rename_symbols.py`
Susko3 Apr 7, 2024
e936173
Switch to ppy.SDL3-CS and update `using`s
Susko3 Apr 7, 2024
4172d68
Convert to regular `using` (from `using static`)
Susko3 Apr 7, 2024
95c9f57
Update pointer types from IntPtr to specific ones
Susko3 Apr 7, 2024
b3706de
Use UTF-8 literals and encoding when passing in strings
Susko3 Apr 7, 2024
57112d0
Use function pointers for callback functions
Susko3 Apr 7, 2024
efdd370
Update display and window event types
Susko3 Apr 7, 2024
c473ac0
Use proper types
Susko3 Apr 7, 2024
78ba63d
Update hint names
Susko3 Apr 7, 2024
ce55edf
Use `fixed` when passing in arrays
Susko3 Apr 7, 2024
6302046
Update to float mouse coordinates in `pollMouse()`
Susko3 Apr 7, 2024
66e8ea1
Simple function signature updates
Susko3 Apr 7, 2024
0923e41
Remove manual Window raw mouse handling
Susko3 Apr 7, 2024
2fb51d0
Migrate SDL_SYSWMEVENT events to SDL_SetWindowsMessageHook()
Susko3 Apr 7, 2024
0e78180
Remove borderless fullscreen on non-Windows platforms
Susko3 Apr 7, 2024
731a0dc
Simplify `TryGetTouchName()` logic
Susko3 Apr 7, 2024
eb734d2
Change `DisplayMode.RefreshRate` to `float`
Susko3 Apr 7, 2024
b0830de
Migrate displays + modes fetch to SDL3
Susko3 Apr 7, 2024
6f8b5dc
Store display ID instead of index
Susko3 Apr 7, 2024
d19fa6e
Get index from SDL_DisplayID
Susko3 Apr 7, 2024
47be5b6
Update ensureWindowOnDisplay() logic and add helper to fetch display …
Susko3 Apr 7, 2024
095a413
Update `tryFetchDisplayMode()`
Susko3 Apr 7, 2024
2e24e8f
Update `getClosestDisplayMode()`
Susko3 Apr 7, 2024
e27bfc5
Use friendly helpers for getting strings from events
Susko3 Apr 7, 2024
f2c1f28
Update touch event handling to use proper types
Susko3 Apr 7, 2024
3a63be8
Update joystick/gamepad event handling to use proper types
Susko3 Apr 7, 2024
91e50aa
Use proper enum type in mouse button handling
Susko3 Apr 7, 2024
1593e95
Migrate from `SDL_GetWindowWMInfo()` to window properties
Susko3 Apr 7, 2024
45473dd
Comment out iOS code without migration path
Susko3 Apr 7, 2024
8fc1645
Remove redundant casts and `unsafe` context
Susko3 Apr 7, 2024
c731d0c
Update `SDL2ControllerBindings`
Susko3 Apr 7, 2024
40c1e41
Set `DllImportResolver` on iOS
Susko3 Apr 7, 2024
5ae8946
Fix cursor not warping in fullscreen on Windows
Susko3 Apr 7, 2024
171920f
Remove custom DPI awareness code
Susko3 Apr 7, 2024
dd51e3c
Use type-friendly properties
Susko3 Apr 7, 2024
e9e73cb
Fix joystick axis not working
Susko3 Apr 7, 2024
d8e14e6
Don't convert float -> int -> float
Susko3 Apr 8, 2024
d16105a
Rename `osu.Framework.Platform.SDL2` to `osu.Framework.Platform.SDL`
Susko3 Apr 8, 2024
2ea78bb
Rename classes from `SDL2*` to `SDL3*`
Susko3 Apr 8, 2024
79d8e44
Replace `SDL2` with `SDL3` in comments / string literals
Susko3 Apr 8, 2024
668fa9c
Remove native logic that supported raw mouse
Susko3 Apr 8, 2024
6b3a997
Fix code inspection
Susko3 Apr 8, 2024
22af688
Enable NRT in `SDL3Extensions`
Susko3 Apr 8, 2024
d5af283
Fix Vulkan+X11 not working
smoogipoo Apr 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace SDL2 with SDL3 in comments / string literals
  • Loading branch information
Susko3 committed Apr 8, 2024
commit 79d8e449cfb88a32b125ae3530ae53aee96b3f80
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void TestChangeCurrentDisplay(WindowState startingState)

WindowMode startingMode = getWindowModeForState(startingState);

// this shouldn't be necessary, but SDL2DesktopWindow doesn't set the config WindowMode when changing the WindowState only.
// this shouldn't be necessary, but SDL3DesktopWindow doesn't set the config WindowMode when changing the WindowState only.
AddStep($"switch to {startingMode}", () => window.WindowMode.Value = startingMode);

AddStep($"switch to {startingState}", () => window.WindowState = startingState);
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Extensions/BridgingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace osu.Framework.Extensions
{
/// <summary>
/// Temporary extension functions for bridging between osuTK, System.Drawing, and System.Numerics
/// Can be removed when the SDL2 migration is complete.
/// Can be removed when the SDL3 migration is complete.
/// </summary>
public static class BridgingExtensions
{
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Platform/GameHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ public void Run(Game game)

ChooseAndSetupRenderer();

// Window creation may fail in the case of a catastrophic failure (ie. graphics driver or SDL2 level).
// Window creation may fail in the case of a catastrophic failure (ie. graphics driver or SDL3 level).
// In such cases, we want to throw here to immediately mark this renderer setup as failed.
if (RequireWindowExists && Window == null)
{
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Platform/Linux/LinuxGameHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected override IEnumerable<InputHandler> CreateAvailableInputHandlers()

foreach (var h in handlers.OfType<MouseHandler>())
{
// There are several bugs we need to fix with Linux / SDL2 cursor handling before switching this on.
// There are several bugs we need to fix with Linux / SDL3 cursor handling before switching this on.
h.UseRelativeMode.Value = false;
h.UseRelativeMode.Default = false;
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Platform/MacOS/MacOSGameHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected override IEnumerable<InputHandler> CreateAvailableInputHandlers()

foreach (var h in handlers.OfType<MouseHandler>())
{
// There are several bugs we need to fix with macOS / SDL2 cursor handling before switching this on.
// There are several bugs we need to fix with macOS / SDL3 cursor handling before switching this on.
h.UseRelativeMode.Value = false;
h.UseRelativeMode.Default = false;
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Platform/OsuTKWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void CancelFlash()
/// osuTK's reference to the current <see cref="DisplayResolution"/> instance is private.
/// Instead we construct a <see cref="DisplayMode"/> based on the metrics of <see cref="CurrentDisplayBindable"/>,
/// as it defers to the current resolution. Note that we round the refresh rate, as osuTK can sometimes
/// report refresh rates such as 59.992863 where SDL2 will report 60.
/// report refresh rates such as 59.992863 where SDL3 will report 60.
/// </summary>
public virtual IBindable<DisplayMode> CurrentDisplayMode
{
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Platform/SDL/SDL3GraphicsSurface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private void initialiseOpenGL()
context = SDL3.SDL_GL_CreateContext(window.SDLWindowHandle);

if (context == IntPtr.Zero)
throw new InvalidOperationException($"Failed to create an SDL2 GL context ({SDL3.SDL_GetError()})");
throw new InvalidOperationException($"Failed to create an SDL3 GL context ({SDL3.SDL_GetError()})");

SDL3.SDL_GL_MakeCurrent(window.SDLWindowHandle, context);

Expand Down
4 changes: 2 additions & 2 deletions osu.Framework/Platform/SDL3Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public virtual void Create()
SDL3.SDL_SetHint(SDL3.SDL_HINT_TOUCH_MOUSE_EVENTS, "0"u8); // disable touch events generating synthetic mouse events on desktop platforms
SDL3.SDL_SetHint(SDL3.SDL_HINT_MOUSE_TOUCH_EVENTS, "0"u8); // disable mouse events generating synthetic touch events on mobile platforms

// we want text input to only be active when SDL2DesktopWindowTextInput is active.
// we want text input to only be active when SDL3DesktopWindowTextInput is active.
// SDL activates it by default on some platforms: https://github.com/libsdl-org/SDL/blob/release-2.0.16/src/video/SDL_video.c#L573-L582
// so we deactivate it on startup.
SDL3.SDL_StopTextInput();
Expand Down Expand Up @@ -271,7 +271,7 @@ protected void RunFrame()
/// </summary>
/// <remarks>
/// As per SDL's recommendation, application events should always be handled via the event filter.
/// See: https://wiki.libsdl.org/SDL2/SDL_EventType#android_ios_and_winrt_events
/// See: https://wiki.libsdl.org/SDL3/SDL_EventType#android_ios_and_winrt_events
/// </remarks>
protected virtual void HandleEventFromFilter(SDL_Event evt)
{
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Platform/SDL3Window_Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private void setupInput(FrameworkConfigManager config)
private bool relativeMouseMode;

/// <summary>
/// Set the state of SDL2's RelativeMouseMode (https://wiki.libsdl.org/SDL_SetRelativeMouseMode).
/// Set the state of SDL3's RelativeMouseMode (https://wiki.libsdl.org/SDL_SetRelativeMouseMode).
/// On all platforms, this will lock the mouse to the window (although escaping by setting <see cref="ConfineMouseMode"/> is still possible via a local implementation).
/// On windows, this will use raw input if available.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Platform/Windows/WindowsMouseHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace osu.Framework.Platform.Windows
{
/// <summary>
/// A windows specific mouse input handler which overrides the SDL2 implementation of raw input.
/// A windows specific mouse input handler which overrides the SDL3 implementation of raw input.
/// This is done to better handle quirks of some devices.
/// </summary>
[SupportedOSPlatform("windows")]
Expand Down