Пример #1
0
        public override bool Equals(object obj)
        {
            if (!(obj is CharPointer))
            {
                return(false);
            }

            CharPointer other = (CharPointer)obj;

            return(pointer == other.pointer);
        }
Пример #2
0
        internal bool TrySetWindowState(WindowState windowState, out CharPointer errMessage)
        {
            errMessage = CharPointer.Null;
            bool success = false;

            if (State != windowState)
            {
                switch (windowState)
                {
                case WindowState.FullScreen:
                    SDLI.SDL_MaximizeWindow(nativePointer);
                    success = SDLI.SDL_SetWindowFullscreen(nativePointer, (uint)windowState) == SUCCESS;

                    break;

                case WindowState.Maximized:
                    SDLI.SDL_MaximizeWindow(nativePointer);
                    success = true;

                    break;

                case WindowState.Desktop:

                    break;

                case WindowState.Windowed:
                default:
                    // restore (??) window

                    break;
                }
            }
            else
            {
                // custom message
                errMessage = $"window state already set: {State}";

                return(false);
            }

            if (!success)
            {
                errMessage = SDLI.SDL_GetError;
            }
            else
            {
                State = windowState;
            }

            return(errMessage == CharPointer.Null);
        }