1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Merge pull request #920 from RogueMacro/master

Some minor fixes for the SDL2 lib
This commit is contained in:
Brian Fiete 2021-02-23 06:03:51 -08:00 committed by GitHub
commit cdb78eec69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 4 deletions

View file

@ -444,7 +444,7 @@ namespace SDL2
[LinkName("SDL_ShowMessageBox")] [LinkName("SDL_ShowMessageBox")]
public static extern int32 ShowMessageBox(ref MessageBoxData messageboxdata, out int32 buttonid); public static extern int32 ShowMessageBox(ref MessageBoxData messageboxdata, out int32 buttonid);
[LinkName("ShowSimpleMessageBox")] [LinkName("SDL_ShowSimpleMessageBox")]
public static extern int SimpleMessageBox( public static extern int SimpleMessageBox(
MessageBoxFlags flags, MessageBoxFlags flags,
char8* title, char8* title,
@ -630,6 +630,26 @@ namespace SDL2
public const WindowPos Undefined = 0x1FFF0000; public const WindowPos Undefined = 0x1FFF0000;
public const WindowPos Centered = 0x2FFF0000; 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] [CRepr]
public struct SDL_DisplayMode public struct SDL_DisplayMode
@ -655,7 +675,7 @@ namespace SDL2
WindowFlags flags WindowFlags flags
); );
[LinkName("SDL_CreateWindowAndRenderer")] [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( public static extern int CreateWindowAndRenderer(
WindowPos width, WindowPos width,
WindowPos height, WindowPos height,
@ -664,6 +684,15 @@ namespace SDL2
out Renderer* renderer out Renderer* renderer
); );
[LinkName("SDL_CreateWindowAndRenderer")]
public static extern int CreateWindowAndRenderer(
int32 width,
int32 height,
WindowFlags window_flags,
out Window* window,
out Renderer* renderer
);
/* data refers to some native window type, IntPtr to an SDL_Window* */ /* data refers to some native window type, IntPtr to an SDL_Window* */
[LinkName("SDL_CreateWindowFrom")] [LinkName("SDL_CreateWindowFrom")]
public static extern Window* SDL_CreateWindowFrom(void* data); public static extern Window* SDL_CreateWindowFrom(void* data);

View file

@ -190,7 +190,7 @@ namespace SDL2
[LinkName("TTF_RenderText_Solid")] [LinkName("TTF_RenderText_Solid")]
public static extern SDL.Surface* RenderText_Solid( public static extern SDL.Surface* RenderText_Solid(
Font* font, Font* font,
char8 text, char8* text,
SDL.Color fg SDL.Color fg
); );
@ -315,4 +315,4 @@ namespace SDL2
int index int index
); );
} }
} }