Display the complete SDL version.

This commit is contained in:
Matthias Mailänder
2026-01-25 11:51:47 +01:00
committed by Gustas Kažukauskas
parent f8c20a0f8d
commit d6af55bc04

View File

@@ -168,7 +168,7 @@ namespace OpenRA.Platforms.Default
Log.Write("graphics", $"SDL initialisation failed: {SDL.SDL_GetError()}"); Log.Write("graphics", $"SDL initialisation failed: {SDL.SDL_GetError()}");
SetSDLAttributes(profile); SetSDLAttributes(profile);
Console.WriteLine($"Using SDL 2 with OpenGL ({profile}) renderer"); Console.WriteLine($"Using SDL {GetSDLVersion()} with OpenGL ({profile}) renderer");
if (videoDisplay < 0 || videoDisplay >= DisplayCount) if (videoDisplay < 0 || videoDisplay >= DisplayCount)
videoDisplay = 0; videoDisplay = 0;
@@ -525,6 +525,12 @@ namespace OpenRA.Platforms.Default
} }
} }
static string GetSDLVersion()
{
SDL.SDL_GetVersion(out var version);
return version.major + "." + version.minor + "." + version.patch;
}
static void SetSDLAttributes(GLProfile profile) static void SetSDLAttributes(GLProfile profile)
{ {
SDL.SDL_GL_ResetAttributes(); SDL.SDL_GL_ResetAttributes();