public ImmediateMode2d(GraphicsDevice device) { this.GraphicsDevice = device; //Effect = new AlphaTestEffect(device); Effect = new BasicEffect(device); Camera = new Cameras.OrthographicCamera(device.Viewport); MatrixStack = new MatrixStack(); Black = new Texture2D(device, 1, 1, false, SurfaceFormat.Color); Black.SetData(new Color[] { new Color(0, 0, 0, 255) }); White = new Texture2D(device, 1, 1, false, SurfaceFormat.Color); White.SetData(new Color[] { new Color(255, 255, 255, 255) }); //Effect.ReferenceAlpha = 32; Effect.TextureEnabled = true; }
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; }