Skip to content

Load SDL3 when using SDL_image or SDL_ttf #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions SDL3_image-CS/SDL3_image/SDL_image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Runtime.CompilerServices;

namespace SDL
{
Expand All @@ -21,5 +22,13 @@ public static unsafe partial class SDL3_image
{
[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
}
}
9 changes: 9 additions & 0 deletions SDL3_ttf-CS/SDL3_ttf/SDL_ttf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Runtime.CompilerServices;

namespace SDL
{
Expand All @@ -19,5 +20,13 @@ public static unsafe partial class SDL3_ttf
{
[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
}
}