Ejemplo n.º 1
0
 private void Happen()
 {
     // iterate through interfaces from the item and load them
     if (_item.GetInterfaces().Count > 0)
     {
         foreach (FunctionalInterface f in _item.GetInterfaces())
         {
             InterfaceRenderer.Render(f, _entity.GetCamera());
         }
         return;
     }
     // lets fail here if the code makes it to this point.
     throw new InterfaceRenderException("No interfaces to render!");
 }
Ejemplo n.º 2
0
        public override void Update(float dtime)
        {
            if (InputHandler != null)
            {
                InputHandler.ProcessMessage(MessageType.Update, new UpdateEventArgs {
                    Dtime = dtime
                });
            }

            if (Direct3DVersion == Direct3DVersion.Direct3D10)
            {
                Device10.ClearRenderTargetView(GraphicsDevice.RenderView, clearColor);
            }
            else
            {
                Device9.Clear(SlimDX.Direct3D9.ClearFlags.Target | SlimDX.Direct3D9.ClearFlags.ZBuffer,
                              clearColor, 1.0f, 0);

                Device9.BeginScene();
            }

            InterfaceRenderer.Render(dtime);
            if (pb != null)
            {
                pb.Value += dtime * 10;
                if (pb.Value > 100)
                {
                    pb.Value = 0;
                }

                tt.SetToolTip(pb, "This is a progress bar\n" + (int)(pb.Value) + "/" + pb.MaxValue);
            }

            //if (cb != null && cb.Checked)
            //{
            //    bvr.Begin(InterfaceScene.Camera);
            //    foreach (var v in Manager.Clickables.All)
            //        bvr.Draw(v.CombinedWorldMatrix, v.PickingLocalBounding, Color.Red);
            //    bvr.End();
            //}

            if (Direct3DVersion == Direct3DVersion.Direct3D9)
            {
                Device9.EndScene();
            }

            Application.MainWindow.Text = "Using " + Direct3DVersion + ", " + FPS.ToString() + " fps";
            System.Console.WriteLine(x++ + " : " + x * 2 + " * " + x * 3 + " - " + x * 4 + " s " + x * 5);
        }
Ejemplo n.º 3
0
        public override void Render()
        {
            _mapRenderer.Render();
            _creatureRenderer.Render();
            _effectsRenderer.Render();
            _interfaceRenderer.Render();


            //MouseState state = Mouse.GetState();
            //int tileX = ((state.X / Engine.GameScale) / Game.SpriteWidth) * Game.SpriteWidth;
            //int tileY = ((state.Y / Engine.GameScale) / Game.SpriteHeight) * Game.SpriteHeight;

            //Draw.Sprite(_tileSelection, new Vector2(tileX, tileY), Color.White);
            //batch.Draw(_tileSelection.Texture, new Vector2(tileX, tileY), _tileSelection.Bounds, Color.White);
        }
Ejemplo n.º 4
0
        public override void Update(float dtime)
        {
            windowsCursor.Position = new Vector2(LocalMousePosition.X, LocalMousePosition.Y);

            Device9.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.FromArgb(1, (int)(0.6 * 255), (int)(0.8 * 255), 255), 1.0f, 0);

            Device9.BeginScene();

            InterfaceRenderer.Render(dtime);
            Application.MainWindow.Text = FPS.ToString();

            Device9.EndScene();

            System.Threading.Thread.Sleep(1000 / 30);
        }