using System; using System.Runtime.InteropServices; namespace DotSDL.Sdl { /// /// Contains the necessary constants and function imports from SDL_video.h. /// internal static class Video { /// /// An enumeration of window statesm. /// [Flags] internal enum WindowFlags : uint { /// Fullscreen window. Fullscreen = 0x00000001, /// Window usable with OpenGL context. OpenGl = 0x00000002, /// Window is visible. Shown = 0x00000004, /// Window is not visible. Hidden = 0x00000008, /// No window decoration. Borderless = 0x00000010, /// Window can be resized. Resizable = 0x00000020, /// Window is minimized. Minimized = 0x00000040, /// Window is maximized. Maximized = 0x00000080, /// Window has grabbed input focus. InputGrabbed = 0x00000100, /// Window has input focus. InputFocus = 0x00000200, /// Window has mouse focus. MouseFocus = 0x00000400, /// Window not created by SDL. Foreign = 0x00000800, /// Fullscreen window at the current desktop resolution. FullscreenDesktop = Fullscreen | 0x00001000, /// Window should be created in high-DPI mode if supported (>= SDL 2.0.1). AllowHighDpi = 0x00002000, /// Window has mouse captured (unrelated to , >= SDL 2.0.4). MouseCapture = 0x00004000, /// Window should always be above others (X11 only, >= SDL 2.0.5). AlwaysOnTop = 0x00008000, /// Window should not be added to the taskbar (X11 only, >= SDL 2.0.5). SkipTaskbar = 0x00010000, /// Window should be treated as a utility window (X11 only, >= SDL 2.0.5). Utility = 0x00020000, /// Window should be treated as a popup (X11 only, >= SDL 2.0.5). Tooltip = 0x00040000, /// Window should be treated as a popup menu (X11 only, >= SDL 2.0.5). PopupMenu = 0x00080000 } internal const uint WindowPosUndefinedMask = 0x1FFF0000; /// Indicates that the window manager should place the window.. internal const uint WindowPosUndefined = WindowPosUndefinedMask; internal static uint WindowPosUndefinedDisplay(uint x) { return WindowPosUndefinedMask | x; } internal const uint WindowPosCenteredMask = 0x2FFF0000; /// Indicates that the window should be in the center of the screen. internal const uint WindowPosCentered = WindowPosCenteredMask; internal static uint WindowPosCenteredDisplay(uint x) { return WindowPosCenteredMask | x; } /// /// Creates a window with the specified position, dimensions, and flags. /// /// The title of the window, in UTF-8 encoding. /// The x position of the window, , or . /// The y position of the window, , or . /// The width of the window, in screen coordinates. /// The height of the window, in screen coordinates. /// One or more OR'd together. /// The window that was created, or NULL on failure. [DllImport(Meta.DllName, EntryPoint = "SDL_CreateWindow", CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr CreateWindow(string title, int x, int y, int w, int h, WindowFlags flags); } }