public SceneProjectionConsole() : base(80, 25)
        {
            PresentationParameters pp = SadConsole.Global.GraphicsDevice.PresentationParameters;

            _renderTexture = new RenderTarget2D(SadConsole.Global.GraphicsDevice, pp.BackBufferWidth, pp.BackBufferHeight, false, SadConsole.Global.GraphicsDevice.DisplayMode.Format, DepthFormat.Depth24);

            _vertices = CreateBox();
            _triangle = CreateTriangle();

            _boxPosition      = new Vector3(1.5f, 0.0f, -0.0f);
            _trianglePosition = new Vector3(-1.5f, 0.0f, -0.0f);

            _effect                    = new BasicEffect(SadConsole.Global.GraphicsDevice);
            _effect.FogEnabled         = false;
            _effect.TextureEnabled     = false;
            _effect.LightingEnabled    = false;
            _effect.VertexColorEnabled = true;
            //_effect.EnableDefaultLighting();
            pixels = new Color[_renderTexture.Width * _renderTexture.Height];
            rasterizerState.CullMode = CullMode.CullCounterClockwiseFace;

            reader1 = new SadConsole.Readers.TextureToSurfaceReader(_renderTexture.Width, _renderTexture.Height, SadConsole.Global.FontDefault);

            UseMouse  = true;
            IsVisible = false;
            toggle    = !toggle;
        }
Пример #2
0
        public SceneProjectionConsole()
            : base(80, 25)
        {
            PresentationParameters pp = SadConsole.Engine.Device.PresentationParameters;
            _renderTexture = new RenderTarget2D(SadConsole.Engine.Device, pp.BackBufferWidth, pp.BackBufferHeight, false, SadConsole.Engine.Device.DisplayMode.Format, DepthFormat.Depth24);

            _vertices = CreateBox();
            _triangle = CreateTriangle();

            _boxPosition = new Vector3(1.5f, 0.0f, -0.0f);
            _trianglePosition = new Vector3(-1.5f, 0.0f, -0.0f);

            _effect = new BasicEffect(SadConsole.Engine.Device);
            _effect.FogEnabled = false;
            _effect.TextureEnabled = false;
            _effect.LightingEnabled = false;
            _effect.VertexColorEnabled = true;
            //_effect.EnableDefaultLighting();
            pixels = new Color[_renderTexture.Width * _renderTexture.Height];
            RasterizerState rasterizerState = new RasterizerState();
            rasterizerState.CullMode = CullMode.CullCounterClockwiseFace;

            reader1 = new SadConsole.Readers.TextureToSurfaceReader(_renderTexture.Width, _renderTexture.Height, SadConsole.Engine.DefaultFont);

            CanUseMouse = true;
            IsVisible = false;
        }