コード例 #1
0
ファイル: UtilGame.cs プロジェクト: ebshimizu/XNAUtils
        public UtilGame()
        {
            graphics = new GraphicsDeviceManager(this)
            {
                PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8
            };

            // Initialize configuration object
            configuration = new Configuration();

            // Initialize camera
            camera = new Camera(this);

            // Initialize the screen manager
            screenManager = new ScreenManager(this, camera, configuration, graphics);

            // Add the screen manager to the components list.
            // Components are special objects that respond to the draw and update loops
            // at a different time than the main application. The main implication of this
            // when using the screen manager is that you don't actually call draw or update
            // on the manager explicitly in this game loop.
            Components.Add(screenManager);

            Content.RootDirectory = "Content";
        }
コード例 #2
0
ファイル: ScreenManager.cs プロジェクト: ebshimizu/XNAUtils
 /// <summary>
 /// Constructs a new screen manager component.
 /// </summary>
 public ScreenManager(Game game, Camera c, Configuration con, GraphicsDeviceManager g)
     : base(game)
 {
     camera = c;
     config = con;
     graphics = g;
 }