示例#1
0
        protected override void OnCreateControl()
        {
            base.OnCreateControl();

            Application.Idle += delegate { Invalidate(); };

            if (!DesignMode)
            {
                device = GraphicsDeviceService.AddRef(Handle, ClientSize.Width, ClientSize.Height);
                services.AddService<IGraphicsDeviceService>(device);
                m_camera = new Camera(device);
                m_gridFloor = new RenderQuad(
                    services,
                    new Vector3(0.0f, 0.0f, 0.0f),
                    new Vector3(0.0f, 1.0f, 0.0f),
                    new Vector3(0.0f, 1.0f, 0.0f),
                    //10, 10,
                    100,100,
                    RenderQuad.ETextureMapMode.eWorldScale,
                    "grid_floor");
            }

            CameraController controller = new CameraController();
            controller.Init(m_camera);
            m_inputControllers.Add("camera_controller", controller);

            AddInputListener(controller, false);
        }
示例#2
0
 public void Init(Camera camera)
 {
     m_camera = camera;
 }