Example #1
0
        protected internal override void SetSupportedOrientations(DisplayOrientation orientations)
        {
            /* XNA on Windows Phone had the ability to change
             * the list of supported device orientations at runtime.
             * Unfortunately, we can't support that reliably across
             * multiple mobile platforms. Therefore this method is
             * essentially a no-op.
             *
             * Instead, you should set your supported orientations
             * in Info.plist (iOS) or AndroidManifest.xml (Android).
             *
             * -caleb
             */

            FNALoggerEXT.LogWarn("Setting SupportedOrientations has no effect!");
        }
Example #2
0
        static FNAPlatform()
        {
            /* I suspect you may have an urge to put an #if in here for new
             * FNAPlatform implementations.
             *
             * DON'T.
             *
             * Determine this at runtime, or load dynamically.
             * No amount of whining will get me to budge on this.
             * -flibit
             */

            // Environment.GetEnvironmentVariable("FNA_PLATFORM_BACKEND");

            // Built-in command line arguments
            LaunchParameters args = new LaunchParameters();
            string           arg;

            if (args.TryGetValue("enablehighdpi", out arg) && arg == "1")
            {
                Environment.SetEnvironmentVariable(
                    "FNA_GRAPHICS_ENABLE_HIGHDPI",
                    "1"
                    );
            }
            if (args.TryGetValue("gldevice", out arg))
            {
                Environment.SetEnvironmentVariable(
                    "FNA3D_FORCE_DRIVER",
                    arg
                    );
            }
            if (args.TryGetValue("disablelateswaptear", out arg) && arg == "1")
            {
                Environment.SetEnvironmentVariable(
                    "FNA3D_DISABLE_LATESWAPTEAR",
                    "1"
                    );
            }
            if (args.TryGetValue("mojoshaderprofile", out arg))
            {
                Environment.SetEnvironmentVariable(
                    "FNA3D_MOJOSHADER_PROFILE",
                    arg
                    );
            }
            if (args.TryGetValue("backbufferscalenearest", out arg) && arg == "1")
            {
                Environment.SetEnvironmentVariable(
                    "FNA3D_BACKBUFFER_SCALE_NEAREST",
                    "1"
                    );
            }
            if (args.TryGetValue("usescancodes", out arg) && arg == "1")
            {
                Environment.SetEnvironmentVariable(
                    "FNA_KEYBOARD_USE_SCANCODES",
                    "1"
                    );
            }

            CreateWindow               = SDL2_FNAPlatform.CreateWindow;
            DisposeWindow              = SDL2_FNAPlatform.DisposeWindow;
            ApplyWindowChanges         = SDL2_FNAPlatform.ApplyWindowChanges;
            GetWindowBounds            = SDL2_FNAPlatform.GetWindowBounds;
            GetWindowResizable         = SDL2_FNAPlatform.GetWindowResizable;
            SetWindowResizable         = SDL2_FNAPlatform.SetWindowResizable;
            GetWindowBorderless        = SDL2_FNAPlatform.GetWindowBorderless;
            SetWindowBorderless        = SDL2_FNAPlatform.SetWindowBorderless;
            SetWindowTitle             = SDL2_FNAPlatform.SetWindowTitle;
            RegisterGame               = SDL2_FNAPlatform.RegisterGame;
            UnregisterGame             = SDL2_FNAPlatform.UnregisterGame;
            PollEvents                 = SDL2_FNAPlatform.PollEvents;
            GetGraphicsAdapters        = SDL2_FNAPlatform.GetGraphicsAdapters;
            GetCurrentDisplayMode      = SDL2_FNAPlatform.GetCurrentDisplayMode;
            GetKeyFromScancode         = SDL2_FNAPlatform.GetKeyFromScancode;
            StartTextInput             = SDL2.SDL.SDL_StartTextInput;
            StopTextInput              = SDL2.SDL.SDL_StopTextInput;
            SetTextInputRectangle      = SDL2_FNAPlatform.SetTextInputRectangle;
            GetMouseState              = SDL2_FNAPlatform.GetMouseState;
            SetMousePosition           = SDL2.SDL.SDL_WarpMouseInWindow;
            OnIsMouseVisibleChanged    = SDL2_FNAPlatform.OnIsMouseVisibleChanged;
            GetRelativeMouseMode       = SDL2_FNAPlatform.GetRelativeMouseMode;
            SetRelativeMouseMode       = SDL2_FNAPlatform.SetRelativeMouseMode;
            GetGamePadCapabilities     = SDL2_FNAPlatform.GetGamePadCapabilities;
            GetGamePadState            = SDL2_FNAPlatform.GetGamePadState;
            SetGamePadVibration        = SDL2_FNAPlatform.SetGamePadVibration;
            GetGamePadGUID             = SDL2_FNAPlatform.GetGamePadGUID;
            SetGamePadLightBar         = SDL2_FNAPlatform.SetGamePadLightBar;
            GetStorageRoot             = SDL2_FNAPlatform.GetStorageRoot;
            GetDriveInfo               = SDL2_FNAPlatform.GetDriveInfo;
            ShowRuntimeError           = SDL2_FNAPlatform.ShowRuntimeError;
            GetMicrophones             = SDL2_FNAPlatform.GetMicrophones;
            GetMicrophoneSamples       = SDL2_FNAPlatform.GetMicrophoneSamples;
            GetMicrophoneQueuedBytes   = SDL2_FNAPlatform.GetMicrophoneQueuedBytes;
            StartMicrophone            = SDL2_FNAPlatform.StartMicrophone;
            StopMicrophone             = SDL2_FNAPlatform.StopMicrophone;
            GetTouchCapabilities       = SDL2_FNAPlatform.GetTouchCapabilities;
            UpdateTouchPanelState      = SDL2_FNAPlatform.UpdateTouchPanelState;
            GetNumTouchFingers         = SDL2_FNAPlatform.GetNumTouchFingers;
            SupportsOrientationChanges = SDL2_FNAPlatform.SupportsOrientationChanges;
            NeedsPlatformMainLoop      = SDL2_FNAPlatform.NeedsPlatformMainLoop;
            RunPlatformMainLoop        = SDL2_FNAPlatform.RunPlatformMainLoop;

            FNALoggerEXT.Initialize();

            AppDomain.CurrentDomain.ProcessExit += SDL2_FNAPlatform.ProgramExit;
            TitleLocation = SDL2_FNAPlatform.ProgramInit(args);
        }