Ejemplo n.º 1
0
        static void Main()
        {
            device = IrrlichtDevice.CreateDevice(DriverType.Direct3D9, new Dimension2Di(1280, 768));             // minimum: 1024 (which is 16x64) x 768 (which is 16x48)
            if (device == null)
            {
                return;
            }

            device.SetWindowCaption("Pathfinding - Irrlicht Engine");
            device.OnEvent += new IrrlichtDevice.EventHandler(device_OnEvent);

            VideoDriver driver          = device.VideoDriver;
            GUIFont     font            = device.GUIEnvironment.GetFont("../../media/fontlucida.png");
            Color       fontNormalColor = Color.SolidWhite;
            Color       fontActionColor = Color.SolidYellow;

            Texture pathfindingTexture = driver.GetTexture("../../media/pathfinding.png");
            int     cellSize           = pathfindingTexture.Size.Height;

            pathfinding = new Pathfinding(64, 48, cellSize, 0, 0);
            pathfinding.SetCell(4, 4, Pathfinding.CellType.Start);
            pathfinding.SetCell(pathfinding.Width - 5, pathfinding.Height - 5, Pathfinding.CellType.Finish);

            while (device.Run())
            {
                driver.BeginScene(ClearBufferFlag.Color);

                pathfinding.FindPath();
                pathfinding.Draw(driver, pathfindingTexture);

                // draw info panel

                Vector2Di v = new Vector2Di(pathfinding.Width * pathfinding.CellSize + 20, 20);
                font.Draw("FPS: " + driver.FPS, v, fontNormalColor);

                v.Y += 32;
                font.Draw("Map size: " + pathfinding.Width + " x " + pathfinding.Height, v, fontNormalColor);
                v.Y += 16;
                font.Draw("Shortest path: " + (pathfinding.PathLength == -1 ? "N/A" : pathfinding.PathLength.ToString()), v, fontNormalColor);
                v.Y += 16;
                font.Draw("Calculation time: " + pathfinding.PathCalcTimeMs + " ms", v, fontNormalColor);

                v.Y += 32;
                font.Draw(workMode ? "[LMB] Set cell impassable" : "[LMB] Set Start cell", v, fontActionColor);
                v.Y += 16;
                font.Draw(workMode ? "[RMB] Set cell passable" : "[RMB] Set Finish cell", v, fontActionColor);
                v.Y += 16;
                font.Draw("[Space] Change mode", v, fontActionColor);

                v.Y += 32;
                font.Draw("[F1] Clean up the map", v, fontActionColor);
                v.Y += 16;
                font.Draw("[F2] Add random blocks", v, fontActionColor);

                driver.EndScene();
            }

            device.Drop();
        }
Ejemplo n.º 2
0
        static void Main()
        {
            device = IrrlichtDevice.CreateDevice(DriverType.Direct3D9, new Dimension2Di(1280, 720));
            if (device == null)
            {
                return;
            }

            VideoDriver  driver = device.VideoDriver;
            SceneManager scene  = device.SceneManager;

            device.SetWindowCaption("Abstract Trace - Irrlicht Engine");
            device.OnEvent += Device_OnEvent;

            GUIFont font      = device.GUIEnvironment.GetFont("../../media/fontlucida.png");
            Color   textColor = Color.SolidWhite;

            CameraSceneNode camera = scene.AddCameraSceneNode();

            camera.FarValue = 20000;
            SceneNodeAnimator a = scene.CreateFlyCircleAnimator(new Vector3Df(), (AbstractTrace.CubeSize * AbstractTrace.GridDim) / 1.25f, 0.000025f, new Vector3Df(0.1f, 1, 0));

            camera.AddAnimator(a);
            a.Drop();

            trace = new AbstractTrace(device);
            trace.Init();

            while (device.Run())
            {
                driver.BeginScene();
                scene.DrawAll();

                if (!isPaused)
                {
                    trace.Step();
                }

                trace.Draw(drawGenerator);

                font.Draw("[G]enerator: " + (drawGenerator ? "ON" : "OFF"), new Vector2Di(20, 20), textColor);
                font.Draw("[P]ause: " + (isPaused ? "ON" : "OFF"), new Vector2Di(20, 35), textColor);
                font.Draw("Cubes: " + trace.GetTotalCubeCount(), new Vector2Di(20, 50), textColor);
                font.Draw("FPS: " + driver.FPS, new Vector2Di(20, 65), textColor);

                driver.EndScene();
            }

            trace.Drop();
            device.Drop();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            device = IrrlichtDevice.CreateDevice(DriverType.OpenGL, new Dimension2Di(1024, 600));
            device.SetWindowCaption("LightningShots - Irrlicht Engine");
            VideoDriver  driver = device.VideoDriver;
            SceneManager smgr   = device.SceneManager;

            device.FileSystem.AddFileArchive("../../media/map-20kdm2.pk3");

            AnimatedMesh  mesh = smgr.GetMesh("20kdm2.bsp");
            MeshSceneNode node = smgr.AddMeshSceneNode(mesh.GetMesh(0));

            node.Position = new Vector3Df(-1300, -144, -1249);

            node.SetMaterialType(MaterialType.LightMapLightingM4);
            node.SetMaterialFlag(MaterialFlag.Lighting, true);

            node.TriangleSelector = smgr.CreateTriangleSelector(node.Mesh, node);
            node.TriangleSelector.Drop();

            smgr.AmbientLight = new Colorf(0.15f, 0.14f, 0.13f);

            CameraSceneNode camera = smgr.AddCameraSceneNodeFPS();

            lightningShot   = new LightningShot(smgr, node.TriangleSelector);
            device.OnEvent += new IrrlichtDevice.EventHandler(device_OnEvent);
            device.CursorControl.Visible = false;

            while (device.Run())
            {
                driver.BeginScene(true, true, new Color(100, 80, 75));

                smgr.DrawAll();

                lightningShot.Draw(device.Timer.Time);

                GUIFont f = device.GUIEnvironment.BuiltInFont;
                f.Draw("Use [LMB] to shoot", 10, 10, Color.OpaqueYellow);
                f.Draw("Total lightnings: " + lightningShot.TotalLightnings, 10, 20, Color.OpaqueWhite);
                f.Draw("Total shots: " + lightningShot.TotalShots, 10, 30, Color.OpaqueWhite);
                f.Draw(driver.FPS + " fps", 10, 40, Color.OpaqueWhite);

                driver.EndScene();
            }

            lightningShot.Drop();
            device.Drop();
        }
Ejemplo n.º 4
0
        static void drawPreviewPlateTooltip()
        {
            if (hoveredNode == null ||
                !hoveredNode.Visible)
            {
                return;
            }

            int k = hoveredNode.ID;

            Texture t = hoveredNode.GetMaterial(0).GetTexture(0);

            if (t != null && t.Name.Path != "NoPreviewTexture")
            {
                k = hoveredNode.ID & (0xFFFFFFF ^ SelectableNodeIdFlag);
            }

            string s = previewPlateInfo.ContainsKey(k)
                                ? previewPlateInfo[k]
                                : "???";

            if (s != null)
            {
                Vector2Di p = irr.Device.CursorControl.Position + new Vector2Di(16);
                GUIFont   f = irr.GUI.Skin.GetFont(GUIDefaultFont.Default);

                Dimension2Di d = f.GetDimension(s);
                d.Inflate(16, 12);

                Recti       r = new Recti(p, d);
                VideoDriver v = irr.Driver;

                int ax = r.LowerRightCorner.X - v.ScreenSize.Width;
                int ay = r.LowerRightCorner.Y - v.ScreenSize.Height;
                if (ax > 0 || ay > 0)
                {
                    if (ax < 0)
                    {
                        ax = 0;
                    }
                    if (ay < 0)
                    {
                        ay = 0;
                    }
                    r.Offset(-ax, -ay);
                }

                v.Draw2DRectangle(r, new Color(0xbb223355));
                v.Draw2DRectangleOutline(r, new Color(0xbb445577));

                f.Draw(s, r.UpperLeftCorner + new Vector2Di(8, 6), Color.SolidYellow);
            }
        }
Ejemplo n.º 5
0
        static void Main()
        {
            device = IrrlichtDevice.CreateDevice(DriverType.OpenGL, new Dimension2Di(800, 600));
            device.SetWindowCaption("Sphere Camera - Irrlicht Engine");
            driver = device.VideoDriver;
            scene  = device.SceneManager;

            sphere = scene.AddSphereSceneNode(5, 100);
            sphere.SetMaterialTexture(0, driver.GetTexture("../../media/earth.jpg"));
            sphere.TriangleSelector = scene.CreateTriangleSelector(sphere.Mesh, sphere);
            sphere.TriangleSelector.Drop();

            scene.AmbientLight = new Colorf(0.2f, 0.2f, 0.2f);
            LightSceneNode light = scene.AddLightSceneNode();

            light.Position = new Vector3Df(-10, 10, -10);

            camera             = new SphereCamera(device, new Vector3Df(0), 8, 20, 10, 0, 0);
            camera.Inclination = 200;

            path = new SpherePath(5.4f);

            GUIFont font = device.GUIEnvironment.BuiltInFont;

            device.OnEvent += new IrrlichtDevice.EventHandler(device_OnEvent);
            device.PostEvent(new Event('r', KeyCode.KeyR, true));             // pretend user pressed [R]

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

                scene.DrawAll();

                path.Draw(driver);

                font.Draw("Press [Arrows], [LMB] and [Mouse Scroll] to change view", 10, 10, Color.SolidYellow);
                font.Draw("Press [RMB] on Earth to place new path point", 10, 20, Color.SolidYellow);
                font.Draw("Press [R] to reload path data from file", 10, 30, Color.SolidYellow);
                font.Draw("Press [C] to clean up", 10, 40, Color.SolidYellow);

                font.Draw(driver.FPS.ToString() + " fps", 10, driver.ScreenSize.Height - 40, Color.SolidYellow);
                font.Draw(path.PointCount.ToString() + " point(s)", 10, driver.ScreenSize.Height - 30, Color.SolidYellow);
                font.Draw(camera.ToString(), 10, driver.ScreenSize.Height - 20, Color.SolidYellow);

                driver.EndScene();
                device.Yield();
            }

            path.Drop();
            device.Drop();
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            device = IrrlichtDevice.CreateDevice(DriverType.Direct3D8, new Dimension2Di(1024, 768));
            if (device == null)
            {
                return;
            }

            device.SetWindowCaption("Fractal Generator - Irrlicht Engine");
            device.OnEvent += new IrrlichtDevice.EventHandler(device_OnEvent);

            VideoDriver driver = device.VideoDriver;
            GUIFont     font   = device.GUIEnvironment.GetFont("../../media/fontlucida.png");
            Color       fontBackgroundColor = new Color(0x7f000000);
            Color       fontNormalColor     = Color.OpaqueWhite;
            Color       fontActionColor     = Color.OpaqueYellow;

            fGen = new FractalGenerator(device);
            fGen.Generate(new Rectd(
                              -driver.ScreenSize.Width / 250.0,
                              -driver.ScreenSize.Height / 250.0,
                              driver.ScreenSize.Width / 250.0,
                              driver.ScreenSize.Height / 250.0));

            while (device.Run())
            {
                driver.BeginScene(false);

                Vector2Di o = null;
                if (mouseMoveStart != null)
                {
                    o = device.CursorControl.Position - mouseMoveStart;
                }

                float w = fGen.DrawAll(o);

                // draw stats

                driver.Draw2DRectangle(new Recti(10, 10, 160, 56 + (w < 1 ? 16 : 0)), fontBackgroundColor);

                Vector2Di v = new Vector2Di(20, 16);
                font.Draw("Max iterations: " + fGen.GetMaxIterations(), v, fontNormalColor);
                v.Y += 16;
                font.Draw("Zoom: " + (long)fGen.GetZoomFactor().X + "x", v, fontNormalColor);
                if (w < 1)
                {
                    v.Y += 16;
                    font.Draw("Computing: " + (int)(w * 100) + "%...", v, fontActionColor);
                }

                // draw help

                int h = driver.ScreenSize.Height;
                driver.Draw2DRectangle(new Recti(10, showHelp ? h - 130 : h - 40, showHelp ? 220 : 160, h - 10), fontBackgroundColor);

                v.Y = h - 34;
                font.Draw("[F1] " + (showHelp ? "Hide" : "Show") + " help", v, fontNormalColor);

                if (showHelp)
                {
                    v.Y = h - 124;
                    font.Draw("[Mouse Left Button] Navigate", v, fontNormalColor);
                    v.Y += 16;
                    font.Draw("[Mouse Wheel] Zoom in/out", v, fontNormalColor);
                    v.Y += 16;
                    font.Draw("[+][-][*][/] Max iterations", v, fontNormalColor);
                    v.Y += 16;
                    font.Draw("[PrintScreen] Save screenshot", v, fontNormalColor);
                    v.Y += 16;
                    font.Draw("[Esc] Exit application", v, fontNormalColor);
                }

                driver.EndScene();
                device.Yield();
            }

            fGen.Drop();
            device.Drop();
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            DriverType driverType;

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

            IrrlichtDevice device = IrrlichtDevice.CreateDevice(driverType, new Dimension2Di(512, 384));

            if (device == null)
            {
                return;
            }

            device.SetWindowCaption("Irrlicht Engine - 2D Graphics Demo");

            VideoDriver driver = device.VideoDriver;

            Texture images = driver.GetTexture("../../media/2ddemo.png");

            driver.MakeColorKeyTexture(images, new Vector2Di(0, 0));

            GUIFont font  = device.GUIEnvironment.BuiltInFont;
            GUIFont font2 = device.GUIEnvironment.GetFont("../../media/fonthaettenschweiler.bmp");

            Recti imp1 = new Recti(349, 15, 385, 78);
            Recti imp2 = new Recti(387, 15, 423, 78);

            driver.Material2D.Layer[0].BilinearFilter = true;
            driver.Material2D.AntiAliasing            = AntiAliasingMode.FullBasic;

            while (device.Run())
            {
                if (device.WindowActive)
                {
                    int time = (int)device.Timer.Time;

                    driver.BeginScene(true, true, new Color(120, 102, 136));

                    // draw fire & dragons background world
                    driver.Draw2DImage(images, new Vector2Di(50, 50),
                                       new Recti(0, 0, 342, 224), null,
                                       new Color(255, 255, 255), true);

                    // draw flying imp
                    driver.Draw2DImage(images, new Vector2Di(164, 125),
                                       (time / 500 % 2) == 1 ? imp1 : imp2, null,
                                       new Color(255, 255, 255), true);

                    // draw second flying imp with colorcylce
                    driver.Draw2DImage(images, new Vector2Di(270, 105),
                                       (time / 500 % 2) == 1 ? imp1 : imp2, null,
                                       new Color(time % 255, 255, 255), true);

                    // draw some text
                    if (font != null)
                    {
                        font.Draw("This demo shows that Irrlicht is also capable of drawing 2D graphics.",
                                  130, 10, new Color(255, 255, 255));
                    }

                    // draw some other text
                    if (font2 != null)
                    {
                        font2.Draw("Also mixing with 3d graphics is possible.",
                                   130, 20, new Color(time % 255, time % 255, 255));
                    }

                    driver.EnableMaterial2D();
                    driver.Draw2DImage(images, new Recti(10, 10, 108, 48), new Recti(354, 87, 442, 118));
                    driver.EnableMaterial2D(false);

                    Vector2Di m = device.CursorControl.Position;
                    driver.Draw2DRectangle(new Recti(m.X - 20, m.Y - 20, m.X + 20, m.Y + 20), new Color(255, 255, 255, 100));

                    driver.EndScene();
                }
            }

            device.Drop();
        }
Ejemplo n.º 8
0
        static void Main(string[] args)
        {
            checkBulletSharpDllPresence();

            // setup Irrlicht

            device = IrrlichtDevice.CreateDevice(DriverType.Direct3D9, new Dimension2Di(1024, 768));
            if (device == null)
            {
                return;
            }

            device.SetWindowCaption("BulletSharp Test - Irrlicht Engine");
            device.OnEvent += new IrrlichtDevice.EventHandler(device_OnEvent);

            VideoDriver  driver = device.VideoDriver;
            SceneManager scene  = device.SceneManager;
            GUIFont      font   = device.GUIEnvironment.GetFont("../../media/fontlucida.png");

            CameraSceneNode camera = scene.AddCameraSceneNodeFPS();

            camera.Position         = new Vector3Df(100, 800, -1000);
            camera.Target           = new Vector3Df(0, 100, 0);
            camera.FarValue         = 30000;
            camera.AutomaticCulling = CullingType.FrustumBox;

            device.CursorControl.Visible = false;

            // setup physics

            physics = new Physics();
            physics.Setup(new Vector3Df(0, -worldGravity, 0));

            // setup particles

            particles = new Particles(device);

            // load quake level

            device.FileSystem.AddFileArchive("../../media/map-20kdm2.pk3");

            Mesh      mesh       = scene.GetMesh("20kdm2.bsp").GetMesh(0);
            SceneNode quakeLevel = scene.AddOctreeSceneNode(mesh, null, -1, 1024);

            quakeLevel.Position = new Vector3Df(-1300, -144, -1249);

            physics.AddShape(Physics.Shape.Mesh, quakeLevel);

            // generate dynamic objects

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 30; j++)
                {
                    for (int k = 0; k < 3; k++)
                    {
                        MeshSceneNode n = scene.AddCubeSceneNode(cubeSize);
                        n.SetMaterialTexture(0, driver.GetTexture("../../media/wall.bmp"));
                        n.SetMaterialFlag(MaterialFlag.Lighting, false);
                        n.Position = new Vector3Df(70 + i * cubeSize, 520 + j * cubeSize, -650 + k * cubeSize);

                        physics.AddShape(Physics.Shape.Box, n, cubeMass);
                    }
                }
            }

            // main loop

            uint curTime       = 0;
            uint lastTime      = 0;
            int  simFps        = 0;
            int  simFrames     = 0;
            uint simFramesTime = 0;

            while (device.Run())
            {
                if (device.WindowActive)
                {
                    // simulate physics

                    lastTime = curTime;
                    curTime  = device.Timer.Time;
                    if (!simPaused)
                    {
                        float deltaTime = (curTime - lastTime) / 1000.0f;
                        bool  b         = physics.StepSimulation(deltaTime);
                        if (b)
                        {
                            simFrames++;
                        }
                    }

                    if (curTime - simFramesTime > 1000)
                    {
                        simFramesTime = curTime;
                        simFps        = simFrames;
                        simFrames     = 0;
                    }

                    // winnow particles

                    particles.Winnow(curTime, simPaused);

                    // render scene

                    driver.BeginScene(true, true, new Color(40, 80, 160));
                    scene.DrawAll();

                    Material material = new Material();
                    material.Lighting = false;
                    device.VideoDriver.SetMaterial(material);

                    // display stats

                    driver.Draw2DRectangle(new Recti(10, 10, 140, 180), new Color(0x7f000000));

                    Vector2Di v = new Vector2Di(20, 20);
                    font.Draw("Rendering", v, Color.OpaqueYellow);
                    v.Y += 16;
                    font.Draw(scene.Attributes.GetValue("calls") + " nodes", v, Color.OpaqueWhite);
                    v.Y += 16;
                    font.Draw(driver.FPS + " fps", v, Color.OpaqueWhite);
                    v.Y += 16;
                    font.Draw("[T]rails " + (useTrails ? "ON" : "OFF"), v, Color.OpaqueGreen);
                    v.Y += 32;
                    font.Draw("Physics" + (simPaused ? " (paused)" : ""), v, Color.OpaqueYellow);
                    v.Y += 16;
                    font.Draw(physics.NumCollisionObjects + " shapes", v, Color.OpaqueWhite);
                    v.Y += 16;
                    font.Draw(simFps + " fps", v, Color.OpaqueWhite);
                    v.Y += 16;
                    font.Draw("[Space] to pause", v, Color.OpaqueGreen);

                    driver.EndScene();
                }

                device.Yield();
            }

            // drop

            physics.Drop();
            device.Drop();
        }
Ejemplo n.º 9
0
        static void Main()
        {
            // setup Irrlicht

            device = IrrlichtDevice.CreateDevice(DriverType.OpenGL, new Dimension2Di(1024, 768), 32, false, true);
            if (device == null)
            {
                return;
            }

            device.SetWindowCaption("Stencil Shadows - Irrlicht Engine");
            device.OnEvent += new IrrlichtDevice.EventHandler(device_OnEvent);

            VideoDriver  driver = device.VideoDriver;
            SceneManager scene  = device.SceneManager;

            GUIFont statsFont = device.GUIEnvironment.GetFont("../../media/fontlucida.png");

            cameraNode          = scene.AddCameraSceneNodeFPS();
            cameraNode.FarValue = 20000;

            device.CursorControl.Visible = false;

            // setup shadows

            shadows = new Shadows(new Color(0xa0000000), 4000);

            // load quake level

            device.FileSystem.AddFileArchive("../../media/map-20kdm2.pk3");

            Mesh          m = scene.GetMesh("20kdm2.bsp").GetMesh(0);
            MeshSceneNode n = scene.AddOctreeSceneNode(m, null, -1, 1024);

            n.Position     = new Vector3Df(-1300, -144, -1249);
            quakeLevelNode = n;

            // add faerie

            faerieNode = scene.AddAnimatedMeshSceneNode(
                scene.GetMesh("../../media/faerie.md2"),
                null, -1,
                new Vector3Df(100, -40, 80),
                new Vector3Df(0, 30, 0),
                new Vector3Df(1.6f));

            faerieNode.SetMD2Animation(AnimationTypeMD2.Wave);
            faerieNode.AnimationSpeed = 20;
            faerieNode.GetMaterial(0).SetTexture(0, driver.GetTexture("../../media/faerie2.bmp"));
            faerieNode.GetMaterial(0).Lighting         = false;
            faerieNode.GetMaterial(0).NormalizeNormals = true;

            shadows.AddObject(faerieNode);

            // add light

            lightMovementHelperNode = scene.AddEmptySceneNode();

            n = scene.AddSphereSceneNode(2, 6, lightMovementHelperNode, -1, new Vector3Df(15, -10, 15));
            n.SetMaterialFlag(MaterialFlag.Lighting, false);

            lightNode = n;
            shadows.AddLight(lightNode);

            // add flashlight

            m = scene.GetMesh("../../media/flashlight.obj");
            n = scene.AddMeshSceneNode(m, lightNode, -1, new Vector3Df(0), new Vector3Df(0), new Vector3Df(5));
            n.SetMaterialFlag(MaterialFlag.Lighting, false);

            flashlightNode         = n;
            flashlightNode.Visible = false;

            // render

            uint shdFrameTime = 0;
            uint shdFrames    = 0;
            uint shdFps       = 0;

            while (device.Run())
            {
                if (useShadowsRebuilding &&
                    shadows.BuildShadowVolume())
                {
                    shdFrames++;
                }

                uint t = device.Timer.Time;
                if (t - shdFrameTime > 1000)
                {
                    shdFrameTime = t;
                    shdFps       = shdFrames;
                    shdFrames    = 0;
                }

                if (useLightBinding)
                {
                    lightMovementHelperNode.Position = cameraNode.AbsolutePosition.GetInterpolated(lightMovementHelperNode.Position, 0.1);
                    lightMovementHelperNode.Rotation = cameraNode.AbsoluteTransformation.Rotation;
                }

                driver.BeginScene(ClearBufferFlag.All, new Color(0xff112244));

                scene.DrawAll();

                if (useShadowsRendering)
                {
                    shadows.DrawShadowVolume(driver);
                }

                // display stats

                driver.Draw2DRectangle(new Recti(10, 10, 150, 220), new Color(0x7f000000));

                Vector2Di v = new Vector2Di(20, 20);
                statsFont.Draw("Rendering", v, Color.SolidYellow);
                v.Y += 16;
                statsFont.Draw(driver.FPS + " fps", v, Color.SolidWhite);
                v.Y += 16;
                statsFont.Draw("[S]hadows " + (useShadowsRendering ? "ON" : "OFF"), v, Color.SolidGreen);
                v.Y += 16;
                statsFont.Draw("[L]ight binding " + (useLightBinding ? "ON" : "OFF"), v, Color.SolidGreen);
                v.Y += 16;
                statsFont.Draw("[F]lashlight " + (useFlashlight ? "ON" : "OFF"), v, Color.SolidGreen);
                v.Y += 32;
                statsFont.Draw("Shadows", v, Color.SolidYellow);
                v.Y += 16;
                statsFont.Draw(shdFps + " fps", v, Color.SolidWhite);
                v.Y += 16;
                statsFont.Draw(shadows.VerticesBuilt + " vertices", v, Color.SolidWhite);
                v.Y += 16;
                statsFont.Draw("[R]ebuilding " + (useShadowsRebuilding ? "ON" : "OFF"), v, Color.SolidGreen);
                v.Y += 16;
                statsFont.Draw("[Q]uake level " + (useShadowsQuakeLevel ? "ON" : "OFF"), v, Color.SolidGreen);

                driver.EndScene();
            }

            shadows.Drop();
            device.Drop();
        }