1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Deprecate CreateWindowAndRenderer() and add WindowPos helpers

This commit is contained in:
RogueMacro 2021-02-21 19:20:29 +01:00 committed by GitHub
parent 45dd528c7b
commit a273d514c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -630,6 +630,26 @@ namespace SDL2
public const WindowPos Undefined = 0x1FFF0000;
public const WindowPos Centered = 0x2FFF0000;
}
public static int WindowPosUndefinedDisplay(int X)
{
return ((.) WindowPos.Undefined | X);
}
public static bool WindowPosIsUndefined(int X)
{
return (X & 0xFFFF0000) == (.) WindowPos.Undefined;
}
public static int WindowPosCenteredDisplay(int X)
{
return ((.) WindowPos.Centered | X);
}
public static bool WindowPosIsCentered(int X)
{
return (X & 0xFFFF0000) == (.) WindowPos.Centered;
}
[CRepr]
public struct SDL_DisplayMode
@ -655,6 +675,15 @@ namespace SDL2
WindowFlags flags
);
[LinkName("SDL_CreateWindowAndRenderer"), Obsolete("This method uses WindowPos as width and height parameter types. Use other method that uses int32 instead.", false)]
public static extern int CreateWindowAndRenderer(
WindowPos width,
WindowPos height,
WindowFlags window_flags,
out Window* window,
out Renderer* renderer
);
[LinkName("SDL_CreateWindowAndRenderer")]
public static extern int CreateWindowAndRenderer(
int32 width,