Skip to content

Upgrade SDL2 to SDL3 - #3

Draft
a-ctor with Copilot wants to merge 3 commits into
masterfrom
copilot/upgrade-to-sdl-3
Draft

Upgrade SDL2 to SDL3#3
a-ctor with Copilot wants to merge 3 commits into
masterfrom
copilot/upgrade-to-sdl-3

Conversation

Copilot AI commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

Migrates the library from SDL2 to SDL3, addressing breaking API changes in initialization, versioning, and rendering.

Changes

Library references

  • Updated DllImport from SDL2SDL3 and SDL2_imageSDL3_image
  • Renamed Sdl2 class to Sdl
  • Updated test interfaces from ISdl2* to ISdl3*

API breaking changes

  • SDL_Init / SDL_InitSubSystem: Now return bool instead of int, changed from SdlResult to SdlBoolResult with UnwrapTrue()
  • SDL_RenderPresent: Now returns bool, changed to SdlBoolResult with UnwrapTrue()
  • Removed deprecated SDL_GetRevision() and SDL_GetRevisionNumber() functions

Before:

public static void Initialize (SdlInitializationFlags flags) 
    => UnsafeNativeMethods.SDL_Init(flags).Unwrap();  // int return

public static string Revision 
    => UnsafeNativeMethods.SDL_GetRevision().AsString();  // removed in SDL3

After:

public static void Initialize (SdlInitializationFlags flags) 
    => UnsafeNativeMethods.SDL_Init(flags).UnwrapTrue();  // bool return

// Revision property removed - no longer available in SDL3

Both main library and Image library build successfully with the changes.

Original prompt

Please upgrade to SDL 3


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 4, 2026 18:11
Co-authored-by: a-ctor <5082673+a-ctor@users.noreply.github.com>
Co-authored-by: a-ctor <5082673+a-ctor@users.noreply.github.com>
Copilot AI changed the title [WIP] Upgrade project to use SDL 3 Upgrade SDL2 to SDL3 Jan 4, 2026
Copilot AI requested a review from a-ctor January 4, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants