コード例 #1
0
ファイル: GameSystemBase.cs プロジェクト: h78hy78yhoi8j/xenko
 /// <summary>
 /// Initializes a new instance of the <see cref="GameSystemBase" /> class.
 /// </summary>
 /// <param name="registry">The registry.</param>
 /// <remarks>
 /// The GameSystem is expecting the following services to be registered: <see cref="IGame"/> and <see cref="IAssetManager"/>.
 /// </remarks>
 protected GameSystemBase(IServiceRegistry registry)
 {
     if (registry == null) throw new ArgumentNullException("registry");
     this.registry = registry;
     game = (GameBase)Services.GetServiceAs<IGame>();
     assetManager = Services.GetSafeServiceAs<IAssetManager>();
 }
コード例 #2
0
        public GamePlatformWindows(GameBase game) : base(game)
        {
            IsBlockingRun = true;
#if SILICONSTUDIO_RUNTIME_CORECLR
                // This is required by the Audio subsystem of SharpDX.
            Win32Native.CoInitialize(IntPtr.Zero);
#endif
        }
コード例 #3
0
        public GamePlatformWindows(GameBase game) : base(game)
        {
            IsBlockingRun = true;
#if SILICONSTUDIO_XENKO_GRAPHICS_API_DIRECT3D
                // This is required by the Audio subsystem of SharpDX.
            Win32Native.CoInitialize(IntPtr.Zero);
#endif
        }
コード例 #4
0
ファイル: GamePlatform.cs プロジェクト: h78hy78yhoi8j/xenko
        public static GamePlatform Create(GameBase game)
        {
#if SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME
            return new GamePlatformWindowsRuntime(game);
#elif SILICONSTUDIO_PLATFORM_ANDROID
            return new GamePlatformAndroid(game);
#elif SILICONSTUDIO_PLATFORM_IOS
            return new GamePlatformiOS(game);
#else
            // Here we cover all Desktop variants: OpenTK, SDL, Winforms,...
            return new GamePlatformWindows(game);
#endif
        }
コード例 #5
0
        public static GamePlatform Create(GameBase game)
        {
#if SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME
            return(new GamePlatformWindowsRuntime(game));
#elif SILICONSTUDIO_PLATFORM_WINDOWS_DESKTOP && SILICONSTUDIO_XENKO_GRAPHICS_API_OPENGL
            return(new GamePlatformOpenTK(game));
#elif SILICONSTUDIO_PLATFORM_ANDROID
            return(new GamePlatformAndroid(game));
#elif SILICONSTUDIO_PLATFORM_IOS
            return(new GamePlatformiOS(game));
#else
            return(new GamePlatformDesktop(game));
#endif
        }
コード例 #6
0
ファイル: GamePlatform.cs プロジェクト: joewan/xenko
        public static GamePlatform Create(GameBase game)
        {
#if SILICONSTUDIO_PLATFORM_WINDOWS_RUNTIME
            return new GamePlatformWindowsRuntime(game);
#elif SILICONSTUDIO_PLATFORM_WINDOWS_DESKTOP && SILICONSTUDIO_XENKO_GRAPHICS_API_OPENGL
            return new GamePlatformOpenTK(game);
#elif SILICONSTUDIO_PLATFORM_ANDROID
            return new GamePlatformAndroid(game);
#elif SILICONSTUDIO_PLATFORM_IOS
            return new GamePlatformiOS(game);
#else
            return new GamePlatformDesktop(game);
#endif
        }
コード例 #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphicsDeviceManager" /> class.
        /// </summary>
        /// <param name="game">The game.</param>
        /// <exception cref="System.ArgumentNullException">The game instance cannot be null.</exception>
        internal GraphicsDeviceManager(GameBase game)
        {
            this.game = game;
            if (this.game == null)
            {
                throw new ArgumentNullException("game");
            }

            lockDeviceCreation = new object();

            // Defines all default values
            SynchronizeWithVerticalRetrace = true;
            PreferredColorSpace            = ColorSpace.Linear;
            PreferredBackBufferFormat      = PixelFormat.R8G8B8A8_UNorm;;
            PreferredDepthStencilFormat    = PixelFormat.D24_UNorm_S8_UInt;
            preferredBackBufferWidth       = DefaultBackBufferWidth;
            preferredBackBufferHeight      = DefaultBackBufferHeight;
            preferredRefreshRate           = new Rational(60, 1);
            PreferredMultiSampleLevel      = MSAALevel.None;
            PreferredGraphicsProfile       = new[]
            {
#if SILICONSTUDIO_PLATFORM_WINDOWS_PHONE
                GraphicsProfile.Level_9_3,
#else
                GraphicsProfile.Level_11_1,
                GraphicsProfile.Level_11_0,
                GraphicsProfile.Level_10_1,
                GraphicsProfile.Level_10_0,
                GraphicsProfile.Level_9_3,
                GraphicsProfile.Level_9_2,
                GraphicsProfile.Level_9_1,
#endif
            };

            // Register the services to the registry
            game.Services.AddService(typeof(IGraphicsDeviceManager), this);
            game.Services.AddService(typeof(IGraphicsDeviceService), this);

            graphicsDeviceFactory = (IGraphicsDeviceFactory)game.Services.GetService(typeof(IGraphicsDeviceFactory));
            if (graphicsDeviceFactory == null)
            {
                throw new InvalidOperationException("IGraphicsDeviceFactory is not registered as a service");
            }

            game.WindowCreated += GameOnWindowCreated;
        }
コード例 #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphicsDeviceManager" /> class.
        /// </summary>
        /// <param name="game">The game.</param>
        /// <exception cref="System.ArgumentNullException">The game instance cannot be null.</exception>
        internal GraphicsDeviceManager(GameBase game)
        {
            this.game = game;
            if (this.game == null)
            {
                throw new ArgumentNullException("game");
            }

            lockDeviceCreation = new object();

            // Defines all default values
            SynchronizeWithVerticalRetrace = true;
            PreferredColorSpace            = ColorSpace.Linear;
            PreferredBackBufferFormat      = PixelFormat.R8G8B8A8_UNorm;;
            PreferredDepthStencilFormat    = PixelFormat.D24_UNorm_S8_UInt;
            preferredBackBufferWidth       = DefaultBackBufferWidth;
            preferredBackBufferHeight      = DefaultBackBufferHeight;
            preferredRefreshRate           = new Rational(60, 1);
            PreferredMultisampleCount      = MultisampleCount.None;
            PreferredGraphicsProfile       = new[]
            {
                GraphicsProfile.Level_11_1,
                GraphicsProfile.Level_11_0,
                GraphicsProfile.Level_10_1,
                GraphicsProfile.Level_10_0,
                GraphicsProfile.Level_9_3,
                GraphicsProfile.Level_9_2,
                GraphicsProfile.Level_9_1,
            };

            graphicsDeviceFactory = game.Services.GetService <IGraphicsDeviceFactory>();
            if (graphicsDeviceFactory == null)
            {
                throw new InvalidOperationException("IGraphicsDeviceFactory is not registered as a service");
            }

            game.WindowCreated += GameOnWindowCreated;
        }
コード例 #9
0
 public GamePlatformWindowsRuntime(GameBase game) : base(game)
 {
     Application.Current.Suspending += CurrentOnSuspending;
     Application.Current.Resuming += CurrentOnResuming;
 }
コード例 #10
0
ファイル: GamePlatform.cs プロジェクト: h78hy78yhoi8j/xenko
 protected GamePlatform(GameBase game)
 {
     this.game = game;
     Services = game.Services;
     Services.AddService(typeof(IGraphicsDeviceFactory), this);
 }
コード例 #11
0
 public GamePlatformWindowsRuntime(GameBase game) : base(game)
 {
 }
コード例 #12
0
 public GamePlatformUWP(GameBase game) : base(game)
 {
     Application.Current.Suspending += CurrentOnSuspending;
     Application.Current.Resuming   += CurrentOnResuming;
 }
コード例 #13
0
 public GamePlatformOpenTK(GameBase game) : base(game)
 {
 }
コード例 #14
0
 public GamePlatformDesktop(GameBase game) : base(game)
 {
     IsBlockingRun = true;
 }
コード例 #15
0
 public GamePlatformAndroid(GameBase game) : base(game)
 {
 }
コード例 #16
0
ファイル: GamePlatform.cs プロジェクト: vol16bit/xenko
 protected GamePlatform(GameBase game)
 {
     this.game = game;
     Services  = game.Services;
 }
コード例 #17
0
ファイル: GraphicsDeviceManager.cs プロジェクト: cg123/xenko
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphicsDeviceManager" /> class.
        /// </summary>
        /// <param name="game">The game.</param>
        /// <exception cref="System.ArgumentNullException">The game instance cannot be null.</exception>
        internal GraphicsDeviceManager(GameBase game)
        {
            this.game = game;
            if (this.game == null)
            {
                throw new ArgumentNullException("game");
            }

            lockDeviceCreation = new object();

            // Defines all default values
            SynchronizeWithVerticalRetrace = true;
            PreferredColorSpace = ColorSpace.Linear;
            PreferredBackBufferFormat = PixelFormat.R8G8B8A8_UNorm;;
            PreferredDepthStencilFormat = PixelFormat.D24_UNorm_S8_UInt;
            preferredBackBufferWidth = DefaultBackBufferWidth;
            preferredBackBufferHeight = DefaultBackBufferHeight;
            preferredRefreshRate = new Rational(60, 1);
            PreferredMultiSampleLevel = MSAALevel.None;
            PreferredGraphicsProfile = new[]
                {
#if SILICONSTUDIO_PLATFORM_WINDOWS_PHONE
                    GraphicsProfile.Level_9_3, 
#else
                    GraphicsProfile.Level_11_1, 
                    GraphicsProfile.Level_11_0, 
                    GraphicsProfile.Level_10_1, 
                    GraphicsProfile.Level_10_0, 
                    GraphicsProfile.Level_9_3, 
                    GraphicsProfile.Level_9_2, 
                    GraphicsProfile.Level_9_1, 
#endif
                };

            // Register the services to the registry
            game.Services.AddService(typeof(IGraphicsDeviceManager), this);
            game.Services.AddService(typeof(IGraphicsDeviceService), this);

            graphicsDeviceFactory = (IGraphicsDeviceFactory)game.Services.GetService(typeof(IGraphicsDeviceFactory));
            if (graphicsDeviceFactory == null)
            {
                throw new InvalidOperationException("IGraphicsDeviceFactory is not registered as a service");
            }

            game.WindowCreated += GameOnWindowCreated;
        }
コード例 #18
0
ファイル: GamePlatform.cs プロジェクト: sonicviz/xenko
 protected GamePlatform(GameBase game)
 {
     this.game = game;
     Services  = game.Services;
     Services.AddService(typeof(IGraphicsDeviceFactory), this);
 }
コード例 #19
0
 public GamePlatformUWP(GameBase game) : base(game)
 {
     Application.Current.Suspending += CurrentOnSuspending;
     Application.Current.Resuming += CurrentOnResuming;
 }
コード例 #20
0
 public GamePlatformAndroid(GameBase game) : base(game)
 {
     PopulateFullName();
 }
コード例 #21
0
ファイル: GamePlatform.iOS.cs プロジェクト: sonicviz/xenko
 public GamePlatformiOS(GameBase game) : base(game)
 {
 }
コード例 #22
0
 public GamePlatformAndroid(GameBase game) : base(game)
 {
 }
コード例 #23
0
ファイル: GamePlatformiOS.cs プロジェクト: joewan/xenko
 public GamePlatformiOS(GameBase game) : base(game)
 {
 }
コード例 #24
0
 public GamePlatformWindowsRuntime(GameBase game) : base(game)
 {
 }
コード例 #25
0
ファイル: GamePlatformOpenTK.cs プロジェクト: joewan/xenko
 public GamePlatformOpenTK(GameBase game) : base(game)
 {
 }
コード例 #26
0
 public GamePlatformWindowsRuntime(GameBase game) : base(game)
 {
     Application.Current.Suspending += CurrentOnSuspending;
     Application.Current.Resuming   += CurrentOnResuming;
 }
コード例 #27
0
 public TestGraphicsDeviceManager(GameBase game)
     : base(game)
 {
 }
コード例 #28
0
ファイル: GamePlatform.iOS.cs プロジェクト: rohitshe/Code
 public GamePlatformiOS(GameBase game) : base(game)
 {
     PopulateFullName();
 }
コード例 #29
0
ファイル: GamePlatformDesktop.cs プロジェクト: joewan/xenko
 public GamePlatformDesktop(GameBase game) : base(game)
 {
     IsBlockingRun = true;
 }
コード例 #30
0
 public GamePlatformAndroid(GameBase game) : base(game)
 {
     PopulateFullName();
 }
コード例 #31
0
ファイル: iOSGameTestControler.cs プロジェクト: cg123/xenko
 public iOSGameTestController(GameBase game)
 {
     this.game = game;
 }