Example #1
0
        public void InitializeRendering(WadToolClass tool, DeviceManager deviceManager)
        {
            if (LicenseManager.UsageMode != LicenseUsageMode.Runtime)
            {
                return;
            }

            Configuration = tool.Configuration;

            base.InitializeRendering(deviceManager.Device, tool.Configuration.RenderingItem_Antialias);
            _tool = tool;

            // Legacy rendering
            {
                _device      = deviceManager.___LegacyDevice;
                _wadRenderer = new WadRenderer(deviceManager.___LegacyDevice);
                new BasicEffect(_device); // This effect is used for editor special meshes like sinks, cameras, light meshes, etc
                _rasterizerWireframe = RasterizerState.New(_device, 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
                });
                _plane = GeometricPrimitive.GridPlane.New(_device, 8, 4);
            }
        }
Example #2
0
 public MoveableContextMenu(WadToolClass tool, WadMoveableId moveableId)
     : base(tool)
 {
     Items.Add(new ToolStripMenuItem("Edit skeleton", Properties.Resources.edit_16, (o, e) =>
     {
         //using (var form = new FormSkeletonEditor(tool,WadToolClass.)
         //     _tool.SelectedObjectEdited();
     }));
 }
Example #3
0
        public void InitializeRendering(WadToolClass tool, DeviceManager deviceManager)
        {
            if (LicenseManager.UsageMode != LicenseUsageMode.Runtime)
            {
                return;
            }

            base.InitializeRendering(deviceManager.Device, tool.Configuration.RenderingItem_Antialias);
            _tool = tool;

            // Actual "InitializeRendering"
            _fontTexture = Device.CreateTextureAllocator(new RenderingTextureAllocator.Description {
                Size = new VectorInt3(512, 512, 2)
            });
            _fontDefault = Device.CreateFont(new RenderingFont.Description {
                FontName = "Segoe UI", FontSize = 24, FontIsBold = true, TextureAllocator = _fontTexture
            });

            // Legacy rendering
            {
                _device        = deviceManager.___LegacyDevice;
                _deviceManager = deviceManager;
                _wadRenderer   = new WadRenderer(_device);
                new BasicEffect(_device); // This effect is used for editor special meshes like sinks, cameras, light meshes, etc
                _rasterizerWireframe = RasterizerState.New(_device, 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
                });
                _gizmo        = new GizmoStaticEditor(_tool.Configuration, _device, _deviceManager.___LegacyEffects["Solid"], this);
                _gizmoLight   = new GizmoStaticEditorLight(_tool.Configuration, _device, _deviceManager.___LegacyEffects["Solid"], this);
                _plane        = GeometricPrimitive.GridPlane.New(_device, 8, 4);
                _littleSphere = GeometricPrimitive.Sphere.New(_device, 2 * 128.0f, 8);
                _sphere       = GeometricPrimitive.Sphere.New(_device, 1024.0f, 6);
            }
        }
Example #4
0
 public BaseContextMenu(WadToolClass tool)
 {
     _tool = tool;
 }