Пример #1
0
        public XgcGame( GameManager gm)
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            // Create all game components.
            FontManagerComponent fm = new FontManagerComponent(this);
            this.Components.Add( fm);
            this.Services.AddService(typeof(IFontManager), fm);

            this.Components.Add(new FpsCounterComponent(this));

            this.Components.Add(new MousePointerComponent(this));

            MouseInputComponent mim = new MouseInputComponent(this);
            this.Components.Add(mim);
            this.Services.AddService(typeof(IMouseInputManager), mim);

            XgcGameComponent xgc = new XgcGameComponent(this, gm);
            this.Components.Add( xgc);
            GameComponent = xgc;
        }
Пример #2
0
        public XnaGame( GameManager gm)
        {
            System.Diagnostics.Debug.WriteLine("XnaGame constructor");
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            // Create all game components.
            FontManagerComponent fm = new FontManagerComponent(this);
            this.Components.Add( fm);
            this.Services.AddService(typeof(IFontManager), fm);

            #if !XBOX360
            this.Components.Add(new MousePointerComponent(this));

            MouseInputComponent mim = new MouseInputComponent(this);
            this.Components.Add(mim);
            this.Services.AddService(typeof(IMouseInputManager), mim);
            #endif

            XgcGameComponent xgc = new XgcGameComponent(this, gm);
            this.Components.Add( xgc);
            GameComponent = xgc;
        }