initialize() static private method

static private initialize ( GraphicsDeviceManager graphicsManager ) : void
graphicsManager GraphicsDeviceManager
return void
示例#1
0
        public Core(int width = 1280, int height = 720, bool isFullScreen = false, bool enableEntitySystems = true, string windowTitle = "Nez", string contentDirectory = "Content")
        {
                        #if DEBUG
            _windowTitle = windowTitle;
                        #endif

            _instance = this;
            emitter   = new Emitter <CoreEvents>(new CoreEventsComparer());

            var graphicsManager = new GraphicsDeviceManager(this);
            graphicsManager.PreferredBackBufferWidth  = width;
            graphicsManager.PreferredBackBufferHeight = height;
            graphicsManager.IsFullScreen = isFullScreen;
            graphicsManager.SynchronizeWithVerticalRetrace = true;
            graphicsManager.DeviceReset += onGraphicsDeviceReset;
            graphicsManager.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;

            Screen.initialize(graphicsManager);
            Window.ClientSizeChanged  += onGraphicsDeviceReset;
            Window.OrientationChanged += onOrientationChanged;

            Content.RootDirectory = contentDirectory;
            content         = new NezGlobalContentManager(Services, Content.RootDirectory);
            IsMouseVisible  = true;
            IsFixedTimeStep = false;

            entitySystemsEnabled = enableEntitySystems;

            // setup systems
            _globalManagers.add(_coroutineManager);
            _globalManagers.add(new TweenManager());
            _globalManagers.add(_timerManager);
            _globalManagers.add(new RenderTarget());
        }
示例#2
0
        public Core(int width = 1280, int height = 720, bool isFullScreen = false, bool enableEntitySystems = true, string windowTitle = "Nez")
        {
                        #if DEBUG
            _windowTitle = windowTitle;
                        #endif

            _instance = this;
            emitter   = new Emitter <CoreEvents>(new CoreEventsComparer());

            var graphicsManager = new GraphicsDeviceManager(this);
            graphicsManager.PreferredBackBufferWidth  = width;
            graphicsManager.PreferredBackBufferHeight = height;
            graphicsManager.IsFullScreen = isFullScreen;
            graphicsManager.SynchronizeWithVerticalRetrace = true;
            graphicsManager.DeviceReset += onGraphicsDeviceReset;
            graphicsManager.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;
            Screen.initialize(graphicsManager);

            Content.RootDirectory = "Content";
            contentManager        = new NezContentManager(Services, Content.RootDirectory);
            IsMouseVisible        = true;
            IsFixedTimeStep       = false;

            entitySystemsEnabled = enableEntitySystems;
        }