예제 #1
0
        public override void InitializeRendering(RenderingDevice device, bool antialias = false)
        {
            base.InitializeRendering(device, antialias);

            _textureAllocator = device.CreateTextureAllocator(new RenderingTextureAllocator.Description {
                Size = new VectorInt3(1024, 1024, 1)
            });

            // Legacy rendering state
            {
                // Reset scrollbar
                _legacyDevice = DeviceManager.DefaultDeviceManager.___LegacyDevice;
                _wadRenderer  = new WadRenderer(DeviceManager.DefaultDeviceManager.___LegacyDevice, true);

                ResetCamera();

                // Initialize the rasterizer state for wireframe drawing
                SharpDX.Direct3D11.RasterizerStateDescription renderStateDesc =
                    new SharpDX.Direct3D11.RasterizerStateDescription
                {
                    CullMode                 = SharpDX.Direct3D11.CullMode.None,
                    DepthBias                = 0,
                    DepthBiasClamp           = 0,
                    FillMode                 = SharpDX.Direct3D11.FillMode.Wireframe,
                    IsAntialiasedLineEnabled = true,
                    IsDepthClipEnabled       = true,
                    IsFrontCounterClockwise  = false,
                    IsMultisampleEnabled     = true,
                    IsScissorEnabled         = false,
                    SlopeScaledDepthBias     = 0
                };
            }
        }