Example #1
0
    public void Render()
    {
        while (running)
        {
            IDevice iDevice = IDevice.Get();
            GDevice gDevice = GDevice.Get();
            LightFireCS.MessageHandler.Get().ProcessEvents();

            if (iDevice.GetKeyState(Tao.Sdl.Sdl.SDLK_ESCAPE))
            {
                running = false;
            }

            gDevice.BeginRender();
            gDevice.SetPerspectiveView();
            camera.UpdatePOCamera();

            blockgNode.Render(camera.ViewFrustum);
            octtreeNode.Render(camera.ViewFrustum);

            //gDevice.SetOrthoView();
            //hud.Render();
            gDevice.EndRender();
        }
    }
Example #2
0
    public int Render()
    {
        while (select)
        {
            LightFireCS.MessageHandler.Get().ProcessEvents();
            GDevice gDevice = GDevice.Get();

            gDevice.BeginRender();
            gDevice.SetOrthoView();
            background.Render();
            WindowManager.Get().Render();
            gDevice.EndRender();
        }

        return(selectedItem);
    }
Example #3
0
    public void Run()
    {
        GDevice gDevice = GDevice.Get();
        IDevice iDevice = IDevice.Get();

        iDevice.MouseMove += new EventHandler(OnMouseMove);
        gDevice.Resize    += new EventHandler(OnResizeWindow);

        while (gDevice.IsRunning)
        {
            MessageHandler.Get().ProcessEvents();

            if (iDevice.GetKeyState(Tao.Sdl.Sdl.SDLK_ESCAPE))
            {
                gDevice.Quit();
            }

            if (iDevice.GetKeyState(Tao.Sdl.Sdl.SDLK_w))
            {
                camera.Position.x -= gDevice.DeltaTime * 0.01 * Math.Sin(camera.Rotation.y * Math.PI / 180.0);
                camera.Position.z -= gDevice.DeltaTime * 0.01 * Math.Cos(camera.Rotation.y * Math.PI / 180.0);
            }

            if (iDevice.GetKeyState(Tao.Sdl.Sdl.SDLK_s))
            {
                camera.Position.x += gDevice.DeltaTime * 0.01 * Math.Sin(camera.Rotation.y * Math.PI / 180.0);
                camera.Position.z += gDevice.DeltaTime * 0.01 * Math.Cos(camera.Rotation.y * Math.PI / 180.0);
            }

            if (iDevice.GetKeyState(Tao.Sdl.Sdl.SDLK_a))
            {
                camera.Rotation.y += gDevice.DeltaTime * 0.05;
            }

            if (iDevice.GetKeyState(Tao.Sdl.Sdl.SDLK_d))
            {
                camera.Rotation.y -= gDevice.DeltaTime * 0.05;
            }

            gDevice.BeginRender();
            gDevice.SetPerspectiveView();
            camera.UpdateCamera();
            bspNode.Render(camera.ViewFrustum);
            gDevice.EndRender();
        }
    }
Example #4
0
    public void Run()
    {
        GDevice gDevice = GDevice.Get();

        while (gDevice.IsRunning)
        {
            MessageHandler.Get().ProcessEvents();

            if (IDevice.Get().GetKeyState(Tao.Sdl.Sdl.SDLK_ESCAPE))
            {
                gDevice.Quit();
            }

            gDevice.BeginRender();
            gDevice.SetOrthoView();
            boxBackground.Render();
            WindowManager.Get().Render();
            windowQuit.WindowFont.Render("FPS: " + gDevice.Fps, new Color(255, 255, 255), new Rect(0, 0, 60, 40));
            gDevice.EndRender();
        }
    }