Example #1
0
        /// <summary>
        /// shows a message box
        /// </summary>
        /// <param name="flags">type of message box</param>
        /// <param name="title">title for the message box</param>
        /// <param name="message">body of the message box</param>
        /// <param name="shouldPause">should the game engine wait for message box to be closed?</param>
        public static unsafe void ShowMessageBox(
            MessageBoxFlags flags,
            string title,
            string message,
            bool shouldPause = false
            )
        {
            var t1 = Task.Run(() =>
            {
                SDL2Native.SDL_ShowSimpleMessageBox(
                    (uint)flags,
                    title,
                    message
                    );
            });

            if (shouldPause)
            {
                t1.Wait();
            }
        }
Example #2
0
        /// <summary>
        /// shows a message box that is parented to this window
        /// </summary>
        /// <param name="flags">type of message box</param>
        /// <param name="title">title for the message box</param>
        /// <param name="message">body of the message box</param>
        /// <param name="shouldPause">should the game engine wait for message box to be closed?</param>
        public unsafe void ShowParentedMessageBox(
            MessageBoxFlags flags,
            string title,
            string message,
            bool shouldPause = false
            )
        {
            var t1 = Task.Run(() =>
            {
                SDL2Native.SDL_ShowSimpleMessageBox(
                    (uint)flags,
                    title,
                    message,
                    (SDL_Window *)_nativeWindow.Handle.NativePointer
                    );
            });

            if (shouldPause)
            {
                t1.Wait();
            }
        }