Update SDL

This commit is contained in:
Gustas
2024-11-15 18:18:33 +02:00
committed by Pavel Penev
parent 874fa67036
commit 7d9aa58103
3 changed files with 6 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj" />
<PackageReference Include="OpenRA-Freetype6" Version="1.0.11" />
<PackageReference Include="OpenRA-OpenAL-CS" Version="1.0.22" />
<PackageReference Include="OpenRA-SDL2-CS" Version="1.0.40" />
<PackageReference Include="OpenRA-SDL2-CS" Version="1.0.41" />
</ItemGroup>
<ItemGroup>
<Content Include="OpenRA.Platforms.Default.dll.config" Condition="'$(TargetPlatform)' != 'win-x64' And '$(TargetPlatform)' != 'win-x86'">

View File

@@ -271,6 +271,10 @@ namespace OpenRA.Platforms.Default
SDL.SDL_GL_GetDrawableSize(Window, out var width, out var height);
surfaceSize = new Size(width, height);
windowScale = width * 1f / windowSize.Width;
// SDL expects OpenGL Context to be on the main thread on OSX by default.
// If this hint isn't set, window management calls will deadlock.
SDL.SDL_SetHint(SDL.SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH, "1");
}
else
windowSize = new Size((int)(surfaceSize.Width / windowScale), (int)(surfaceSize.Height / windowScale));