Beispiel #1
0
 public void Draw(Geo.CompiledModel model)
 {
     device.SetVertexBuffer(model.verticies);
     device.Indices = model.indicies;
     device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, model.verticies.VertexCount,
                                  0, System.Math.Min(model.primitiveCount, 65535));
 }
Beispiel #2
0
        public Renderable(GraphicsDevice device, GuiDriver module, int width, int height, Euler Euler = null)
        {
            this.module      = module;
            this.Orientation = Euler;
            if (this.Orientation == null)
            {
                this.Orientation = new Euler();
            }

            uiCamera        = new Render.Cameras.OrthographicCamera(new Viewport(0, 0, width, height));
            uiRoot          = new UIItem(new Rectangle(0, 0, width, height));
            uiRoot.settings = new PropertySet();

            uiCamera.focus = new Vector2(width / 2, height / 2);

            renderTarget = new RenderTarget2D(device, uiCamera.Viewport.Width, uiCamera.Viewport.Height);
            var rawGuiQuad = Geo.Gen.CreateQuad();

            rawGuiQuad      = Geo.Gen.FacetCopy(rawGuiQuad);
            quadModel       = Geo.CompiledModel.CompileModel(rawGuiQuad, device);
            uiRoot.defaults = module.defaultSettings;
        }