Initial commit: Theriapolis baseline at port/godot branch point
Captures the pre-Godot-port state of the codebase. This is the rollback anchor for the Godot port (M0 of theriapolis-rpg-implementation-plan-godot-port.md). All Phase 0 through Phase 6.5 work is included; Phase 7 is in flight. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Theriapolis.Game.Platform;
|
||||
|
||||
/// <summary>
|
||||
/// Cross-platform clipboard writer via SDL2, which MonoGame.Framework.DesktopGL
|
||||
/// already loads. Silently no-ops if the native call fails so debug-only callers
|
||||
/// never crash the game.
|
||||
/// </summary>
|
||||
public static class Clipboard
|
||||
{
|
||||
[DllImport("SDL2", EntryPoint = "SDL_SetClipboardText", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern int SDL_SetClipboardText([MarshalAs(UnmanagedType.LPUTF8Str)] string text);
|
||||
|
||||
public static bool TrySetText(string text)
|
||||
{
|
||||
try { return SDL_SetClipboardText(text) == 0; }
|
||||
catch { return false; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user