Skip to content

Commit

Permalink
Merge pull request #6226 from smoogipoo/update-sdl
Browse files Browse the repository at this point in the history
Update SDL2 package + use `SDL_GetWindowSizeInPixels`
  • Loading branch information
peppy authored Mar 26, 2024
2 parents 3f59b97 + 163ac2a commit ddb7add
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
24 changes: 1 addition & 23 deletions osu.Framework/Platform/SDL2/SDL2GraphicsSurface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,7 @@ public void Initialise()

public Size GetDrawableSize()
{
int width, height;

switch (Type)
{
case GraphicsSurfaceType.OpenGL:
default:
SDL.SDL_GL_GetDrawableSize(window.SDLWindowHandle, out width, out height);
break;

case GraphicsSurfaceType.Vulkan:
SDL.SDL_Vulkan_GetDrawableSize(window.SDLWindowHandle, out width, out height);
break;

case GraphicsSurfaceType.Metal:
SDL.SDL_Metal_GetDrawableSize(window.SDLWindowHandle, out width, out height);
break;

case GraphicsSurfaceType.Direct3D11:
// todo: SDL has no "drawable size" method for D3D11, return window size for now.
SDL.SDL_GetWindowSize(window.SDLWindowHandle, out width, out height);
break;
}

SDL.SDL_GetWindowSizeInPixels(window.SDLWindowHandle, out int width, out int height);
return new Size(width, height);
}

Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/osu.Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" />
<PackageReference Include="ppy.osuTK.NS20" Version="1.0.211" />
<PackageReference Include="StbiSharp" Version="1.1.0" />
<PackageReference Include="ppy.SDL2-CS" Version="1.0.693-alpha" />
<PackageReference Include="ppy.SDL2-CS" Version="1.0.741-alpha" />
<PackageReference Include="ppy.osu.Framework.SourceGeneration" Version="2023.720.0" />

<!-- DO NOT use ProjectReference for native packaging project.
Expand Down

0 comments on commit ddb7add

Please sign in to comment.