Exemplo n.º 1
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            camera = new FreeLookCamera(this);
            cameraHandler = new CameraHandler(this);
            Cubes = new Cubes(this);

            Components.Add(camera);
            Components.Add(cameraHandler);
            Components.Add(Cubes);

            Services.AddService(typeof(ICameraService), camera);
        }
Exemplo n.º 2
0
        public Safari()
        {
            graphics = new GraphicsDeviceManager(this);
            //graphics.PreferredBackBufferWidth = 1366;
            //graphics.PreferredBackBufferHeight = 768;
            //graphics.IsFullScreen = true;

            Content.RootDirectory = "Content";

            // Komponenten erstellen
            camera = new FreeLookCamera(this);
            ground = new Ground(this);
            lights = new Lights(this);
            skybox = new Skybox(this);
            tigers = new Tigers(this);
            cubes = new Cubes(this);
            ray = new Line(this);

            cameraTracker = new CameraTracker(this, camera);
            cameraHandler = new CameraHandler(this, camera);

            // Komponenten zur Liste hinzufügen
            Components.Add(cameraTracker);
            Components.Add(cameraHandler);
            Components.Add(camera);
            Components.Add(skybox);
            Components.Add(lights);
            Components.Add(tigers);
            Components.Add(ground);
            Components.Add(cubes);
            Components.Add(ray);

            // Services zur Liste hinzufügen
            Services.AddService(typeof(ICameraService), camera);
            Services.AddService(typeof(ILightService), lights);

            // Antialiasing aktivieren
            graphics.PreferMultiSampling = true;
        }