Load SDL3 when using `SDL_image` or `SDL_ttf` members

This commit is contained in:
Dan Balasescu 2025-06-20 01:49:35 +09:00
parent 66fc81f489
commit ce5cb5da0e
No known key found for this signature in database
2 changed files with 18 additions and 0 deletions

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using System.Runtime.CompilerServices;
namespace SDL namespace SDL
{ {
@ -21,5 +22,13 @@ namespace SDL
{ {
[Constant] [Constant]
public static readonly int SDL_IMAGE_VERSION = SDL3.SDL_VERSIONNUM(SDL_IMAGE_MAJOR_VERSION, SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_MICRO_VERSION); public static readonly int SDL_IMAGE_VERSION = SDL3.SDL_VERSIONNUM(SDL_IMAGE_MAJOR_VERSION, SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_MICRO_VERSION);
#pragma warning disable CA2255
[ModuleInitializer]
internal static void ModuleInitializer()
{
SDL3.SDL_Init(0);
}
#pragma warning restore CA2255
} }
} }

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using System.Runtime.CompilerServices;
namespace SDL namespace SDL
{ {
@ -19,5 +20,13 @@ namespace SDL
{ {
[Constant] [Constant]
public static readonly int SDL_TTF_VERSION = SDL3.SDL_VERSIONNUM(SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_MICRO_VERSION); public static readonly int SDL_TTF_VERSION = SDL3.SDL_VERSIONNUM(SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_MICRO_VERSION);
#pragma warning disable CA2255
[ModuleInitializer]
internal static void ModuleInitializer()
{
SDL3.SDL_Init(0);
}
#pragma warning restore CA2255
} }
} }