diff --git a/SDL3_image-CS/SDL3_image/SDL_image.cs b/SDL3_image-CS/SDL3_image/SDL_image.cs index 275bf23..8910191 100644 --- a/SDL3_image-CS/SDL3_image/SDL_image.cs +++ b/SDL3_image-CS/SDL3_image/SDL_image.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Runtime.CompilerServices; namespace SDL { @@ -21,5 +22,13 @@ namespace SDL { [Constant] 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 } } diff --git a/SDL3_ttf-CS/SDL3_ttf/SDL_ttf.cs b/SDL3_ttf-CS/SDL3_ttf/SDL_ttf.cs index c1a9b08..3642887 100644 --- a/SDL3_ttf-CS/SDL3_ttf/SDL_ttf.cs +++ b/SDL3_ttf-CS/SDL3_ttf/SDL_ttf.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Runtime.CompilerServices; namespace SDL { @@ -19,5 +20,13 @@ namespace SDL { [Constant] 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 } }