Beispiel #1
0
        static void Main(string[] args)
        {
            int  N = AskUserForN();
            bool B = AskUserForB();

            DriverType driverType;

            if (!AskUserForDriver(out driverType))
            {
                return;
            }

            IrrlichtDevice device = IrrlichtDevice.CreateDevice(driverType, new Dimension2Di(800, 600));

            if (device == null)
            {
                return;
            }

            device.CursorControl.Visible = false;

            CameraSceneNode camera = device.SceneManager.AddCameraSceneNodeFPS();

            camera.FarValue = 20000;
            camera.Position = new Vector3Df(-200);
            camera.Target   = new Vector3Df(0);

            MeshBuffersBatch batch = new MeshBuffersBatch(device, N, B);

            while (device.Run())
            {
                device.VideoDriver.BeginScene();

                device.SceneManager.DrawAll();

                batch.Draw();

                device.VideoDriver.EndScene();

                device.SetWindowCaption(
                    "Fast static rendering - Irrlicht Lime - " +
                    device.VideoDriver.Name + " | " +
                    device.VideoDriver.FPS + " fps | " +
                    N * N * N + " cubes  | " +
                    device.VideoDriver.PrimitiveCountDrawn + " primitives | " +
                    MemUsageText + " of physical memory used");
            }

            batch.Drop();
            device.Drop();
        }
Beispiel #2
0
		static void Main(string[] args)
		{
			int N = AskUserForN();
			bool B = AskUserForB();

			DriverType driverType;
			if (!AskUserForDriver(out driverType))
				return;

			IrrlichtDevice device = IrrlichtDevice.CreateDevice(driverType, new Dimension2Di(800, 600));
			if (device == null)
				return;

			device.CursorControl.Visible = false;

			CameraSceneNode camera = device.SceneManager.AddCameraSceneNodeFPS();
			camera.FarValue = 20000;
			camera.Position = new Vector3Df(-200);
			camera.Target = new Vector3Df(0);

			MeshBuffersBatch batch = new MeshBuffersBatch(device, N, B);

			while (device.Run())
			{
				device.VideoDriver.BeginScene();

				device.SceneManager.DrawAll();

				batch.Draw();

				device.VideoDriver.EndScene();

				device.SetWindowCaption(
					"Fast static rendering - Irrlicht Lime - " +
					device.VideoDriver.Name + " | " +
					device.VideoDriver.FPS + " fps | " +
					N * N * N + " cubes  | " +
					device.VideoDriver.PrimitiveCountDrawn + " primitives | " +
					MemUsageText + " of physical memory used");
			}

			batch.Drop();
			device.Drop();
		}