• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Framework.GraphicsDeviceManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.Xna.Framework.GraphicsDeviceManager的典型用法代码示例。如果您正苦于以下问题:C# GraphicsDeviceManager类的具体用法?C# GraphicsDeviceManager怎么用?C# GraphicsDeviceManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GraphicsDeviceManager类属于Microsoft.Xna.Framework命名空间,在下文中一共展示了GraphicsDeviceManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Alligator

        public Alligator(Game game, GraphicsDeviceManager graphics, Vector2 location)
            : base(game, graphics, "content/alligator", true)
        {
            this.mLocation = location;


        }
开发者ID:IainCargill,项目名称:froggerxna,代码行数:7,代码来源:Alligator.cs


示例2: GameBase

        public GameBase(Orientation orientation)
            : base()
        {
            _instance = this;

            GraphicsDeviceManager graphics = new GraphicsDeviceManager(this);

            if (orientation == Orientation.Portrait)
            {
                graphics.SupportedOrientations = DisplayOrientation.Portrait | DisplayOrientation.PortraitDown;
            }
            else
            {
                graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
            }

            graphics.IsFullScreen = true;

            Content.RootDirectory = "Content";

            GlobalTimerController.ClearInstance();
            TouchProcessor.ClearInstance();

            _scenes = new Dictionary<Type, Scene>();
            _currentScene = null;
            _tombstoneFileName = DefaultTombstoneFileName;
            _sceneTransitionCrossFadeTextureName = "";

            PurchaseManager = new External_APIS.iOS.InAppPurchaseManager();
        }
开发者ID:Ben-P-Leda,项目名称:Bopscotch-IOS,代码行数:30,代码来源:GameBase.cs


示例3: FarseerPhysicsGame

        public FarseerPhysicsGame()
        {
            Window.Title = "Farseer Samples Framework";
            _graphics = new GraphicsDeviceManager(this);
            _graphics.PreferMultiSampling = true;
            #if WINDOWS || XBOX
            _graphics.PreferredBackBufferWidth = 1280;
            _graphics.PreferredBackBufferHeight = 720;
            ConvertUnits.SetDisplayUnitToSimUnitRatio(24f);
            IsFixedTimeStep = true;
            #elif WINDOWS_PHONE
            _graphics.PreferredBackBufferWidth = 800;
            _graphics.PreferredBackBufferHeight = 480;
            ConvertUnits.SetDisplayUnitToSimUnitRatio(16f);
            IsFixedTimeStep = false;
            #endif
            #if WINDOWS
            _graphics.IsFullScreen = false;
            #elif XBOX || WINDOWS_PHONE
            _graphics.IsFullScreen = true;
            #endif

            Content.RootDirectory = "Content";

            //new-up components and add to Game.Components
            ScreenManager = new ScreenManager(this);
            Components.Add(ScreenManager);

            FrameRateCounter frameRateCounter = new FrameRateCounter(ScreenManager);
            frameRateCounter.DrawOrder = 101;
            Components.Add(frameRateCounter);
        }
开发者ID:AdamNThompson,项目名称:Farseer-MonoGame-WinGL,代码行数:32,代码来源:FarseerPhysicsGame.cs


示例4: WizardryGameServer

        /// <summary>
        /// Default constructor for the WizardryGameServer class.
        /// </summary>
        public WizardryGameServer()
        {
            graphics = new GraphicsDeviceManager( this );
            Content.RootDirectory = "Content";
            textureProvider = new TextureProvider( Content );

            // Windows Settings for the XNA window
            Window.Title = "Wizardry Server";
            graphics.PreferredBackBufferWidth = 200;
            graphics.PreferredBackBufferHeight = 1;

            // Set up the lobbies list
            lobbies = new GameLobby[GameSettings.MAX_LOBBIES];
            for ( int i = 0; i < GameSettings.MAX_LOBBIES; ++i )
            {
                lobbies[i] = null;
            }

            playerLobbies = new ConcurrentDictionary<long, int>();

            // Setup the server configuration
            NetPeerConfiguration config = new NetPeerConfiguration( GameSettings.APP_NAME );
            config.Port = GameSettings.SERVER_PORT_NUM;
            config.EnableMessageType( NetIncomingMessageType.DiscoveryRequest );

            // Start the server
            server = new NetServer( config );
            server.Start();
            WriteConsoleMessage( "Server starting!" );

            // Start the Packet Receiver thread
            Thread packets = new Thread( new ThreadStart( this.PacketProcessor ) );
            packets.Start();
        }
开发者ID:nezek6,项目名称:Wizardry,代码行数:37,代码来源:WizardryGameServer.cs


示例5: ResetScreenScale

 public Vector3 ResetScreenScale(GraphicsDeviceManager graphics, Vector2 screenScale)
 {
     var scaleX = (float)graphics.GraphicsDevice.Viewport.Width / screenScale.X;
     var scaleY = (float)graphics.GraphicsDevice.Viewport.Height / screenScale.Y;
     Scale = new Vector3(scaleX, scaleY, 1.0f);
     return Scale;
 }
开发者ID:AGDGMintDev,项目名称:ECSRogue,代码行数:7,代码来源:Camera.cs


示例6: AppDelegate

 public AppDelegate(Game game, GraphicsDeviceManager graphics)
     : base(game, graphics)
 {
     this.game = game;
     CCApplication.sm_pSharedApplication = this;
     this.setOrientation(Orientation.kOrientationLandscapeLeft);
 }
开发者ID:hj458377603,项目名称:FlappyBird,代码行数:7,代码来源:AppDelegate.cs


示例7: MonoSAMGame

		protected MonoSAMGame()
		{
			CurrentTime = new GameTime();

			Graphics = new GraphicsDeviceManager(this);
			Content.RootDirectory = "Content";
		}
开发者ID:Mikescher,项目名称:GridDominance,代码行数:7,代码来源:MonoSAMGame.cs


示例8: Initialize

 public static void Initialize(Game game, GraphicsDeviceManager graphics)
 {
     GlobalContent.game = game;
     GlobalContent.graphics = graphics;
     GlobalContent.content = game.Content;
     GlobalContent.Initialized = true;
 }
开发者ID:oconnerj,项目名称:TyrantsQuest,代码行数:7,代码来源:GlobalContent.cs


示例9: Camera2D

 public Camera2D(GraphicsDeviceManager graphics, Vector2 lookAt, float zoomLevel)
 {
     screenCenter = new Vector2(graphics.GraphicsDevice.Viewport.Width / 2.0f, graphics.GraphicsDevice.Viewport.Height / 2.0f);
     this.lookAt = lookAt;
     this.zoomLevel = zoomLevel;
     this.zoomOrigin = screenCenter;
 }
开发者ID:AnyKey,项目名称:tojam4,代码行数:7,代码来源:Camera2D.cs


示例10: State

 public State(ContentManager content, GraphicsDeviceManager graphics, Player player)
 {
     _content = content;
     _graphics = graphics;
     _player = player;
     _firstFrame = true;
 }
开发者ID:anxkha,项目名称:Mortuum,代码行数:7,代码来源:State.cs


示例11: MonoGameImpl

 public MonoGameImpl()
 {
     _graphics = new GraphicsDeviceManager(this);
     _graphics.PreferredBackBufferWidth = 1280;
     _graphics.PreferredBackBufferHeight = 720;
     Content.RootDirectory = "Content";
 }
开发者ID:srakowski,项目名称:coldsteel,代码行数:7,代码来源:MonoGameImpl.cs


示例12: BallerburgGame

        /// <summary>
        /// Initializes a new instance of the BallerburgGame class
        /// </summary>
        public BallerburgGame()
        {
            Instance = this;
              gameSettings = new GameSettings();
              playerSettings = new PlayerSettings[4];

              applicationSettings = new ApplicationSettings();

              graphics = new GraphicsDeviceManager(this)
                     {
                       PreferredBackBufferWidth = 640,
                       PreferredBackBufferHeight = 480
                     };

              graphicsManager = new BallerburgGraphicsManager();
              contentManager = new ContentManager();
              shaderManager = new ShaderManager();
              audioManager = new AudioManager(applicationSettings, contentManager);
              gameObjectManager = new GameObjectManager(contentManager, this.audioManager, this.graphicsManager);

              MousePointer = new MousePointer(this)
                         {
                           DrawOrder = 1000,
                           RestrictZone = new Rectangle(0, 0, 640, 480)
                         };
              Components.Add(MousePointer);

              // Create the screen manager component.
              screenManager = new ScreenManager(graphicsManager, contentManager, gameObjectManager, applicationSettings, gameSettings, shaderManager, audioManager, playerSettings)
                          {
                            GameMousePointer = MousePointer
                          };
        }
开发者ID:urmuelle,项目名称:MonoGameBallerburg,代码行数:36,代码来源:BallerburgGame.cs


示例13: GameStateManagementGame

        public GameStateManagementGame()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);
            //TargetElapsedTime = TimeSpan.FromTicks(333333);
            TargetElapsedTime = TimeSpan.FromTicks(333);

            #if WINDOWS_PHONE
            graphics.IsFullScreen = true;
            InitializeLandscapeGraphics();
            #endif

            screenFactory = new ScreenFactory();
            Services.AddService(typeof(IScreenFactory), screenFactory);
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            #if WINDOWS_PHONE
            // hook
            Microsoft.Phone.Shell.PhoneApplicationService.Current.Launching +=
                new EventHandler<Microsoft.Phone.Shell.LaunchingEventArgs>(GameLaunching);
            Microsoft.Phone.Shell.PhoneApplicationService.Current.Activated +=
                new EventHandler<Microsoft.Phone.Shell.ActivatedEventArgs>(GameActivated);
            Microsoft.Phone.Shell.PhoneApplicationService.Current.Deactivated +=
                new EventHandler<Microsoft.Phone.Shell.DeactivatedEventArgs>(GameDeactivated);
            #else
            AddInitialScreens();
            #endif
            gameMusic = Content.Load<SoundEffect>("sounds/GamePlayHalfBit");
            gameMusicI = gameMusic.CreateInstance();
            gameMusicI.IsLooped = true;
            gameMusicI.Play();
        }
开发者ID:alexcoco,项目名称:trace_racer,代码行数:34,代码来源:Celestial.cs


示例14: Initialize

        /// <summary>
        /// Initializes game & graphics based on config.
        /// </summary>
        /// <param name="game"></param>
        /// <param name="graphicsDeviceManager"></param>
        public void Initialize(Game game, GraphicsDeviceManager graphicsDeviceManager)
        {
            this.Game = game;
            this.GraphicsDeviceManager = graphicsDeviceManager;

            // set custom resolution if required
            if (this.Config.Screen.Width != 0 && this.Config.Screen.Height != 0)
            {
                this.GraphicsDeviceManager.PreferredBackBufferWidth = this.Config.Screen.Width;
                this.GraphicsDeviceManager.PreferredBackBufferHeight = this.Config.Screen.Height;
            }

            // set full screen mode.
            this.GraphicsDeviceManager.IsFullScreen = this.Config.Screen.IsFullScreen;

            // set vsync.
            this.Game.IsFixedTimeStep = this.Config.Graphics.IsFixedTimeStep;
            this.GraphicsDeviceManager.SynchronizeWithVerticalRetrace = this.Config.Graphics.IsVsyncEnabled;

            // set mouse mode.
            this.Game.IsMouseVisible = this.Config.Input.IsMouseVisible;

            // set orientation.
            this.GraphicsDeviceManager.SupportedOrientations = this.Config.Screen.SupportedOrientations;

            this.Initialize();

            this.GraphicsDeviceManager.ApplyChanges();
        }
开发者ID:Cyberbanan,项目名称:voxeliq,代码行数:34,代码来源:PlatformHandler.cs


示例15: Game1

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.DeviceCreated += new EventHandler<EventArgs>(graphics_DeviceCreated);
            // graphics.ApplyChanges();
            Content.RootDirectory = "Content";

//            if (graphics.GraphicsDevice == null)
//            {
//                CCLog.Log("FOO");
//            }

            graphics.IsFullScreen = false;

            // Frame rate is 30 fps by default for Windows Phone.
            // Divide by 2 to make it 60 fps
            TargetElapsedTime = TimeSpan.FromTicks(333333 / 2);
            IsFixedTimeStep = true;

            IsMouseVisible = true;

            // Extend battery life under lock.
            //InactiveSleepTime = TimeSpan.FromSeconds(1);

            CCApplication application = new AppDelegate(this, graphics);
            Components.Add(application);

#if !WINDOWS_PHONE && !XBOX && !WINDOWS
            GamerServicesComponent component = new GamerServicesComponent(this);
            this.Components.Add(component);
#endif
        }
开发者ID:huaqiangs,项目名称:cocos2d-xna,代码行数:32,代码来源:Game1.cs


示例16: FormManager

        public FormManager(GraphicsDeviceManager _graphics, Game _game, Manager _manager)
        {
            this.graphics = _graphics;
            this.parent = _game;

            manager = _manager;
        }
开发者ID:summer-of-software,项目名称:vtank,代码行数:7,代码来源:FormManager.cs


示例17: Game

        public Game()
        {
            graphics = new GraphicsDeviceManager(this);
              Content.RootDirectory = "Content";
              graphics.IsFullScreen = true;
              InitializeLandscapeGraphics();
              // Frame rate is 30 fps by default for Windows Phone.
              TargetElapsedTime = TimeSpan.FromTicks(333333);

              // Extend battery life under lock.
              InactiveSleepTime = TimeSpan.FromSeconds(1);

              screenFactory = new ScreenFactory();
              Services.AddService(typeof(IScreenFactory), screenFactory);

              screenManager = new ScreenManager(this);
              Components.Add(screenManager);

              Microsoft.Phone.Shell.PhoneApplicationService.Current.Launching +=
                new EventHandler<Microsoft.Phone.Shell.LaunchingEventArgs>(GameLaunching);
              Microsoft.Phone.Shell.PhoneApplicationService.Current.Activated +=
              new EventHandler<Microsoft.Phone.Shell.ActivatedEventArgs>(GameActivated);
              Microsoft.Phone.Shell.PhoneApplicationService.Current.Deactivated +=
              new EventHandler<Microsoft.Phone.Shell.DeactivatedEventArgs>(GameDeactivated);
        }
开发者ID:TheFerrango,项目名称:SpotASheep,代码行数:25,代码来源:Game.cs


示例18: GDGameScreen

		public GDGameScreen(MainGame game, GraphicsDeviceManager gdm, LevelFile bp, FractionDifficulty diff) : base(game, gdm)
		{
			blueprint = bp;
			difficulty = diff;

			Initialize();
		}
开发者ID:Mikescher,项目名称:GridDominance,代码行数:7,代码来源:GDGameScreen.cs


示例19: Io2GameLibGame

        /// <summary>
        /// Initializes io2GameLib
        /// </summary>
        public Io2GameLibGame()
        {
            // Regular initialization stuff
            Content.RootDirectory = "Content";
            Graphics = new GraphicsDeviceManager(this);
            Graphics.IsFullScreen = true;

            // Extend battery life under lock.
            // InactiveSleepTime = TimeSpan.FromSeconds(1); // CRASH on WIN8

            // Create the settings object
            Settings = new GameLibSettings();

            // Create the screenmanager
            ScreenManager = new ScreenManager(this);
            Components.Add(ScreenManager);

            // Add the default background screen
            ScreenManager.AddScreen(new BackgroundScreen());

            // Let the user get a change to initialize there own services
            InitializeServices();

            // Register the default services
            RegisterDefaultServices();

            // An old construct still alive
            Io2GameLibGame.instance = this;
        }
开发者ID:johankson,项目名称:io2gamelib,代码行数:32,代码来源:GameLibGame.cs


示例20: Game1

        public Game1()
        {
            // jazyk
            Thread.CurrentThread.CurrentUICulture	=	CultureInfo.GetCultureInfo("cs-CZ");

            this.graphics	=	new GraphicsDeviceManager(this);

            // rozmìry okna
            this.graphics.PreferredBackBufferWidth	=	733;
            this.graphics.PreferredBackBufferHeight	=	608;

            this.Content.RootDirectory	=	"Content";

            TargetElapsedTime = TimeSpan.FromTicks(333333);

            // Create the screen factory and add it to the Services
            screenFactory = new ScreenFactory();
            Services.AddService(typeof(IScreenFactory), screenFactory);

            // Create the screen manager component.
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            this.AddInitialScreens();
        }
开发者ID:kubakista,项目名称:Battle-City,代码行数:25,代码来源:Game.cs



注:本文中的Microsoft.Xna.Framework.GraphicsDeviceManager类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Framework.Matrix类代码示例发布时间:2022-05-26
下一篇:
C# Framework.GameWindow类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap