Exemple #1
0
        public void Prepare(Model model)
        {
            var renderData = new RenderData();

            using (var data = new DataStream(model.Indices.ToArray(), true, false))
                renderData.IndexBuffer = new Buffer(device, data, model.Indices.Count * sizeof(int), ResourceUsage.Default, BindFlags.IndexBuffer, CpuAccessFlags.None, ResourceOptionFlags.None);
            using (var data = new DataStream(model.VertexData.Positions.ToArray(), true, false))
                renderData.VertexBuffer = new Buffer(device, data, model.VertexData.Positions.Count * Vector3.SizeInBytes, ResourceUsage.Default, BindFlags.VertexBuffer, CpuAccessFlags.None, ResourceOptionFlags.None);
        }
        public void SendMapData(RenderData<RenderTile> mapData, int columns, int rows)
        {
            m_shaderDataPerFrame.ColRow = new Vector2(columns, rows);

            DataStream stream;
            var box = m_device.ImmediateContext.MapSubresource(m_tileBuffer, MapMode.WriteDiscard, SharpDX.Direct3D11.MapFlags.None, out stream);
            stream.WriteRange(mapData.Grid, 0, mapData.Width * mapData.Height);
            m_device.ImmediateContext.UnmapSubresource(m_tileBuffer, 0);
            stream.Dispose();
        }
Exemple #3
0
        public Form1()
        {
            m_scene = new WinFormsScene(this.Handle);

            m_symbolDrawingCache = new SymbolDrawingCache(new Uri("/Symbols/SymbolInfosGfx.xaml", UriKind.Relative));
            m_scene.SymbolDrawingCache = m_symbolDrawingCache;

            m_renderData = new RenderData<RenderTileDetailed>();
            m_scene.SetRenderData(m_renderData);

            InitializeComponent();
        }
        /// <inheritdoc/>
        public override void PrepareEffectPermutationsImpl(RenderDrawContext context)
        {
            base.PrepareEffectPermutationsImpl(context);

            var renderEffects   = RenderData.GetData(renderEffectKey);
            int effectSlotCount = EffectPermutationSlotCount;

            // Update existing materials
            foreach (var material in allMaterialInfos)
            {
                material.Key.Setup(context.RenderContext);
            }

            foreach (var renderObject in RenderObjects)
            {
                var staticObjectNode      = renderObject.StaticObjectNode;
                var renderParticleEmitter = (RenderParticleEmitter)renderObject;

                var material     = renderParticleEmitter.ParticleEmitter.Material;
                var materialInfo = renderParticleEmitter.ParticleMaterialInfo;

                for (int i = 0; i < effectSlotCount; ++i)
                {
                    var staticEffectObjectNode = staticObjectNode * effectSlotCount + i;
                    var renderEffect           = renderEffects[staticEffectObjectNode];

                    // Skip effects not used during this frame
                    if (renderEffect == null || !renderEffect.IsUsedDuringThisFrame(RenderSystem))
                    {
                        continue;
                    }

                    if (materialInfo == null || materialInfo.Material != material)
                    {
                        // First time this material is initialized, let's create associated info
                        if (!allMaterialInfos.TryGetValue(material, out materialInfo))
                        {
                            materialInfo = new ParticleMaterialInfo(material);
                            allMaterialInfos.Add(material, materialInfo);
                        }
                        renderParticleEmitter.ParticleMaterialInfo = materialInfo;

                        // Update new materials
                        material.Setup(context.RenderContext);
                    }

                    // TODO: Iterate PermuatationParameters automatically?
                    material.ValidateEffect(context.RenderContext, ref renderEffect.EffectValidator);
                }
            }
        }
Exemple #5
0
        public void DrawRectAppearance(
            Texture2D texture,
            Vector3 Position,
            Vector2 size,
            Color4 color,
            Vector2 topleft,
            Vector2 topright,
            Vector2 bottomleft,
            Vector2 bottomright,
            Vector3 normal,
            float angle,
            int layer,
            BlendMode blend = BlendMode.Normal
            )
        {
            var up       = normal;
            var toCamera = (camera.Position - Position).Normalized();
            var right    = Vector3.Cross(toCamera, up);

            up.Normalize();
            right.Normalize();
            rendat[billboardCount] = new RenderData(
                texture,
                blend,
                RenderKind.Basic,
                (ushort)vertexCountBasic
                );
            //construct points then billboard them?
            CreateBillboard(
                Position,
                size,
                color,
                angle,
                topleft,
                topright,
                bottomleft,
                bottomright,
                right,
                up
                );
            var z = RenderHelpers.GetZ(camera.Position, Position);

            buffer.AddCommand(
                this,
                rendat[billboardCount].GetHashCode(),
                billboardCount,
                layer,
                z
                );
            billboardCount++;
        }
 public bool DeepEquals(DestinyItemComponentSetOfint64?other)
 {
     return(other is not null &&
            (Instances is not null ? Instances.DeepEquals(other.Instances) : other.Instances is null) &&
            (RenderData is not null ? RenderData.DeepEquals(other.RenderData) : other.RenderData is null) &&
            (Stats is not null ? Stats.DeepEquals(other.Stats) : other.Stats is null) &&
            (Sockets is not null ? Sockets.DeepEquals(other.Sockets) : other.Sockets is null) &&
            (ReusablePlugs is not null ? ReusablePlugs.DeepEquals(other.ReusablePlugs) : other.ReusablePlugs is null) &&
            (PlugObjectives is not null ? PlugObjectives.DeepEquals(other.PlugObjectives) : other.PlugObjectives is null) &&
            (TalentGrids is not null ? TalentGrids.DeepEquals(other.TalentGrids) : other.TalentGrids is null) &&
            (PlugStates is not null ? PlugStates.DeepEquals(other.PlugStates) : other.PlugStates is null) &&
            (Objectives is not null ? Objectives.DeepEquals(other.Objectives) : other.Objectives is null) &&
            (Perks is not null ? Perks.DeepEquals(other.Perks) : other.Perks is null));
 }
            protected virtual void Initialise()
            {
                //Init data
                _renderedObjects = new List <RenderData>(kMaxMeshes);
                _instanceData    = new T[kMaxMeshes];
                _renderData      = new RenderData[kMaxMeshes];
                for (int i = 0; i < _renderData.Length; i++)
                {
                    _renderData[i] = new RenderData();
                }
                _renderedObjectTransforms = new Matrix4x4[kMaxMeshes];

                _propertyBlock = new MaterialPropertyBlock();
            }
Exemple #8
0
        private void AddedNewGroup(int groupno, GLBuffer matrixbuffer)      // callback due to new group added, we need a texture and a RI
        {
            var texture = new GLTexture2DArray();

            items.Add(texture);
            texture.CreateOrUpdateTexture(bitmapsize.Width, bitmapsize.Height, matrixbuffers.Matricesperbuffer, textureformat, texmipmaplevels);
            grouptextureslist.Add(texture); // need to keep these for later addition

            var rd             = new RenderData(texture);
            var renderableItem = GLRenderableItem.CreateMatrix4(items, OpenTK.Graphics.OpenGL4.PrimitiveType.Quads, renderstate, matrixbuffer, 0, 4, rd, ic: 0);     //drawcount=4 (4 vertexes made up by shader), ic will be set in Add.

            renderlist.Add(shader, name + ":" + groupno, renderableItem);
            grouprenderlist.Add(renderableItem);
        }
 protected virtual void RenderBody(SerializedPropertyX property, RenderData data, int index)
 {
     EditorGUI.indentLevel++;
     for (int i = 0; i < property.ChildCount; i++)
     {
         SerializedPropertyX child = property.GetChildAt(i);
         if (skipRenderingFields.IndexOf(child.name) != -1)
         {
             continue;
         }
         EditorGUILayoutX.PropertyField(child, child.label, child.isExpanded);
     }
     EditorGUI.indentLevel--;
 }
Exemple #10
0
        public RenderData <BlockRenderData>[] EndData()
        {
            var rd = RenderData <BlockRenderData> .Create(_RenderManager,
                                                          SharpDX.Direct3D.PrimitiveTopology.PointList, _CurrentBuffer, _CurrentBufferPos);

            _RenderData.Add(rd);

            _SetupRenderData(rd);

            _CurrentBuffer    = null;
            _CurrentBufferPos = 0;

            return(_RenderData.ToArray());
        }
Exemple #11
0
        public Page(ProcessedDataPackage pacakge)
        {
            RenderData r = (RenderData)pacakge[typeof(RenderData)];

            ID              = "page_" + pacakge.CollectionID;
            Title           = "MSFast Collection #" + pacakge.CollectionID;
            StartedDateTime = Converter.EpochToDateTime(pacakge.CollectionStartTime);

            PageTimings = new PageTimings(pacakge);

            PageSourceData sd = (PageSourceData)pacakge[typeof(PageSourceData)];

            this.PageSourceData = Convert.ToBase64String(Encoding.UTF8.GetBytes(sd.PageSource));
        }
    //刷草的时候
    public void FreshTex(RenderData data)
    {
        Texture2D texture = mTexture;

        for (int y = 0; y < texture.height; y++)
        {
            for (int x = 0; x < texture.width; x++)
            {
                texture.SetPixel(x, y, data.terrians[y * texture.width + x] / MeshEditor.heightMax);
            }
        }
        mTexture.Apply();
        //mMat.SetTexture("_Terrian", mTexture);
    }
    public void OutputTex2D(string filename, RenderData data)
    {
        Texture2D texture = mTexture;

        for (int y = 0; y < texture.height; y++)
        {
            for (int x = 0; x < texture.width; x++)
            {
                texture.SetPixel(x, y, data.terrians[y * texture.width + x] / MeshEditor.heightMax);
            }
        }
        texture.Apply();
        System.IO.File.WriteAllBytes(filename, texture.EncodeToPNG());
    }
Exemple #14
0
        static void Main(string[] args)
        {
            Dispaly = new Display(1920, 1080);

            TestWorld = new Scene();

            GameObject Ground = TestWorld.AddGameObject(0, 1000, 0);

            // Load Scene Image Data
            RenderData  SceneImageData = new RenderData();
            RenderState GroundImage    = SceneImageData.LoadFile("Ground.png");

            // Load Player Image Data
            PlayerImageData = new RenderData();
            PlayerImage1    = PlayerImageData.LoadFile("Test.bmp");
            PlayerImage2    = PlayerImageData.LoadFile("StateTest.png");

            // Load Projectile Image Data
            ProjectileImageData = new RenderData();
            ProjectileImageData.LoadFile("Projectile.png");

            // Create PhysicsConstraints
            PlayerPhysics     = new PhysicsConstraints(TestWorld);
            StaticPhysics     = new PhysicsConstraints(TestWorld);
            ProjectilePhysics = new PhysicsConstraints(TestWorld);

            PlayerPhysics.Collider         = true;
            StaticPhysics.Static           = true;
            ProjectilePhysics.Collider     = true;
            ProjectilePhysics.OnCollision += OnProjectileCollision;


            Player1       = new Player(TestWorld);
            Player1_Child = TestWorld.AddGameObject(100, 100, 0);
            Player1_Child.Use(PlayerImageData);
            Player1_Child.Use(Player1.Transform);

            Ground.Use(SceneImageData);
            Ground.Use(StaticPhysics);


            KeyListener.AddKeyBind(Key.Up, () => { Camera.Yvel += -CameraSpeed; }, () => { Camera.Yvel -= -CameraSpeed; });
            KeyListener.AddKeyBind(Key.Left, () => { Camera.Xvel += -CameraSpeed; }, () => { Camera.Xvel -= -CameraSpeed; });
            KeyListener.AddKeyBind(Key.Down, () => { Camera.Yvel += CameraSpeed; }, () => { Camera.Yvel -= CameraSpeed; });
            KeyListener.AddKeyBind(Key.Right, () => { Camera.Xvel += CameraSpeed; }, () => { Camera.Xvel -= CameraSpeed; });

            Debugger.EnableDebugger = true;
            Dispaly.Start();
        }
Exemple #15
0
        public bool Equals(DestinyItemComponentSetOfuint32 input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Instances == input.Instances ||
                     (Instances != null && Instances.Equals(input.Instances))
                     ) &&
                 (
                     RenderData == input.RenderData ||
                     (RenderData != null && RenderData.Equals(input.RenderData))
                 ) &&
                 (
                     Stats == input.Stats ||
                     (Stats != null && Stats.Equals(input.Stats))
                 ) &&
                 (
                     Sockets == input.Sockets ||
                     (Sockets != null && Sockets.Equals(input.Sockets))
                 ) &&
                 (
                     ReusablePlugs == input.ReusablePlugs ||
                     (ReusablePlugs != null && ReusablePlugs.Equals(input.ReusablePlugs))
                 ) &&
                 (
                     PlugObjectives == input.PlugObjectives ||
                     (PlugObjectives != null && PlugObjectives.Equals(input.PlugObjectives))
                 ) &&
                 (
                     TalentGrids == input.TalentGrids ||
                     (TalentGrids != null && TalentGrids.Equals(input.TalentGrids))
                 ) &&
                 (
                     PlugStates == input.PlugStates ||
                     (PlugStates != null && PlugStates.Equals(input.PlugStates))
                 ) &&
                 (
                     Objectives == input.Objectives ||
                     (Objectives != null && Objectives.Equals(input.Objectives))
                 ) &&
                 (
                     Perks == input.Perks ||
                     (Perks != null && Perks.Equals(input.Perks))
                 ));
        }
Exemple #16
0
        private void createRenderData(GameVoxel added)
        {
            var vizs = added.Type.GetCustomVisualizers(added).ToArray();

            if (!vizs.Any())
            {
                return;
            }
            foreach (var v in vizs)
            {
                v.Show();
            }

            visualizers[added] = new RenderData(vizs, added.Type);
        }
 public bool DeepEquals(DestinyItemResponse?other)
 {
     return(other is not null &&
            CharacterId == other.CharacterId &&
            (Item is not null ? Item.DeepEquals(other.Item) : other.Item is null) &&
            (Instance is not null ? Instance.DeepEquals(other.Instance) : other.Instance is null) &&
            (Objectives is not null ? Objectives.DeepEquals(other.Objectives) : other.Objectives is null) &&
            (Perks is not null ? Perks.DeepEquals(other.Perks) : other.Perks is null) &&
            (RenderData is not null ? RenderData.DeepEquals(other.RenderData) : other.RenderData is null) &&
            (Stats is not null ? Stats.DeepEquals(other.Stats) : other.Stats is null) &&
            (TalentGrid is not null ? TalentGrid.DeepEquals(other.TalentGrid) : other.TalentGrid is null) &&
            (Sockets is not null ? Sockets.DeepEquals(other.Sockets) : other.Sockets is null) &&
            (ReusablePlugs is not null ? ReusablePlugs.DeepEquals(other.ReusablePlugs) : other.ReusablePlugs is null) &&
            (PlugObjectives is not null ? PlugObjectives.DeepEquals(other.PlugObjectives) : other.PlugObjectives is null));
 }
Exemple #18
0
 public void Execute()
 {
     for (int i = 0; i < renderDatas.Length; i++)
     {
         for (int j = i; j < renderDatas.Length - 1; j++)
         {
             if (renderDatas[j].position.y < renderDatas[j + 1].position.y)
             {
                 RenderData temp = renderDatas[j];
                 renderDatas[j]     = renderDatas[j + 1];
                 renderDatas[j + 1] = temp;
             }
         }
     }
 }
Exemple #19
0
        private void Form1_Load(object sender, EventArgs e)
        {
            oldClientSize = this.ClientSize;

            settings = new Settings();

            renderManager = new RenderManager();
            renderManager.CreateDefaultControl();

            /*
             * if (!renderManager.CreateControl("MeshRenderer.SharpGL2.dll", new string[] { "SharpGL.dll" }))
             * {
             *  renderManager.CreateDefaultControl();
             *
             *  if (frmLog == null)
             *  {
             *      frmLog = new FormLog();
             *  }
             *
             *  frmLog.AddItem("Failed to initialize OpenGL.", true);
             * }
             */

            var control = renderManager.RenderControl;

            if (control != null)
            {
                this.splitContainer1.Panel2.Controls.Add(control);

                // Initialize control
                control.BackColor = Color.Black;
                control.Dock      = DockStyle.Fill;
                control.Font      = new Font("Consolas", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
                control.Location  = new System.Drawing.Point(0, 0);
                control.Name      = "renderControl1";
                control.Size      = new Size(703, 612);
                control.TabIndex  = 0;
                control.Text      = "meshRenderer1";

                renderManager.Initialize();
            }
            else
            {
                DarkMessageBox.Show("Ooops ...", "Failed to initialize renderer.");
            }

            renderData = new RenderData();
        }
Exemple #20
0
        internal void SetResults(ProcessedDataPackage package, int index)
        {
            lastRenderTimestamp = 0;
            if (package == null)
            {
                //  Clear();
                return;
            }

            lock (setResultsLock)
            {
                this.currentResultsIndex = index;

                if (lastPackageHashNumber != package.GetHashCode())
                {
                    this.currentResults        = null;
                    this.package               = package;
                    this.lastPackageHashNumber = package.GetHashCode();

                    if (package.ContainsKey(typeof(BrokenSourceData)) != false &&
                        String.IsNullOrEmpty(((BrokenSourceData)package[typeof(BrokenSourceData)]).PageSource) == false &&
                        ((BrokenSourceData)package[typeof(BrokenSourceData)]).InjectionBreaks != null)
                    {
                        BrokenSourceData brokenSourceData = ((BrokenSourceData)package[typeof(BrokenSourceData)]);

                        SourcePiece[] sp = new SourcePiece[brokenSourceData.InjectionBreaks.Count];
                        int           i  = 0;
                        foreach (SourcePiece s in brokenSourceData.InjectionBreaks)
                        {
                            sp[i] = s;
                            i++;
                        }
                        this.currentResults = sp;
                        SetBuffer(brokenSourceData.PageSource);
                    }
                    if (package.ContainsKey(typeof(RenderData)) != false)
                    {
                        RenderData rd = (RenderData)package[typeof(RenderData)];
                        foreach (RenderedSegment rs in rd.Values)
                        {
                            lastRenderTimestamp = Math.Max(lastRenderTimestamp, rs.EndTime);
                        }
                    }
                }

                RedrawResultsNextPrev();
            }
        }
Exemple #21
0
        public void DrawPerspective(
            Texture2D texture,
            Vector3 Position,
            Vector2 size,
            Color4 color,
            Vector2 topleft,
            Vector2 topright,
            Vector2 bottomleft,
            Vector2 bottomright,
            Vector3 normal,
            float angle,
            int layer,
            BlendMode blend = BlendMode.Normal
            )
        {
            var right = Vector3.Cross(normal, Vector3.UnitY);
            var up    = Vector3.Cross(right, normal);

            up.Normalize();
            right.Normalize();
            rendat[billboardCount] = new RenderData(
                texture,
                blend,
                (ushort)vertexCount
                );
            CreateBillboard(
                Position,
                size,
                color,
                angle,
                topleft,
                topright,
                bottomleft,
                bottomright,
                right,
                up
                );
            var z = RenderHelpers.GetZ(camera.Position, Position);

            buffer.AddCommand(
                this,
                rendat[billboardCount].GetHashCode(),
                billboardCount,
                layer,
                z
                );
            billboardCount++;
        }
 public void Execute()
 {
     for (int i = 0; i < dataArray.Length; i++)
     {
         for (int j = i + 1; j < dataArray.Length; j++)
         {
             if (dataArray[i].position.y < dataArray[j].position.y)
             {
                 //SWAP
                 RenderData temp = dataArray[i];
                 dataArray[i] = dataArray[j];
                 dataArray[j] = temp;
             }
         }
     }
 }
 public void Execute()
 {
     for (int i = 0; i < sortArray.Length; i++)
     {
         for (int j = 0; j < sortArray.Length; j++)
         {
             if (sortArray[i].position.y > sortArray[j].position.y)
             {
                 //swap
                 RenderData tmpRenderData = sortArray[i];
                 sortArray[i] = sortArray[j];
                 sortArray[j] = tmpRenderData;
             }
         }
     }
 }
Exemple #24
0
    public void ReferenceLightmaps(List <int> lightmapIndices)
    {
        lightmapRefs.Clear();
        int numIndices = lightmapIndices.Count;

        for (int index = 0; index < numIndices; ++index)
        {
            int lightmapIndex = lightmapIndices[index];
            if (lightmapIndex >= 0 && lightmapIndex < LightmapSettings.lightmaps.Length)
            {
                RefData newRef = new RefData();
                newRef.index        = lightmapIndex;
                newRef.NearLightmap = LightmapSettings.lightmaps[lightmapIndex].lightmapDir;
                newRef.FarLightmap  = LightmapSettings.lightmaps[lightmapIndex].lightmapColor;
                lightmapRefs.Add(newRef);
            }
        }

#if UNITY_5
        lightmapRenderRefs.Clear();
        Transform[] transforms    = GetComponentsInChildren <Transform>();
        int         numTransforms = transforms.Length;
        for (int transformIndex = 0; transformIndex < numTransforms; ++transformIndex)
        {
            Renderer renderer = transforms[transformIndex].GetComponent <Renderer>();
            Terrain  terrain  = transforms[transformIndex].GetComponent <Terrain>();
            if ((renderer != null && renderer.lightmapIndex >= 0) ||
                (terrain != null && terrain.lightmapIndex >= 0))
            {
                RenderData newIndex = new RenderData();
                if (renderer)
                {
                    newIndex.renderer = renderer;
                    newIndex.rendererLightmapIndex       = renderer.lightmapIndex;
                    newIndex.rendererLightmapScaleOffset = renderer.lightmapScaleOffset;
                    GameObjectUtility.SetStaticEditorFlags(renderer.gameObject, GameObjectUtility.GetStaticEditorFlags(renderer.gameObject) & ~StaticEditorFlags.BatchingStatic);
                }
                if (terrain)
                {
                    newIndex.terrain = terrain;
                    newIndex.terrainLightmapIndex = terrain.lightmapIndex;
                }
                lightmapRenderRefs.Add(newIndex);
            }
        }
#endif
    }
    public void Test_RenderData_AuthorEqualsNullIfPageAndSiteAreNull()
    {
        var file = new Kaylumah.Ssg.Manager.Site.Service.Files.Processor.File()
        {
            MetaData = new FileMetaData
            {
            }
        };
        var PageMetaData = file.ToPage();
        var SiteMetaData = new SiteMetaData(new PageMetaData[] { PageMetaData });
        var sut          = new RenderData {
            Site = SiteMetaData, Page = PageMetaData
        };

        sut.Should().NotBeNull();
        sut.Author.Should().BeNull();
    }
Exemple #26
0
        // Use this for initialization
        void Start()
        {
            m_DefaultTimeScale = Time.timeScale;

            // cache all renderer data
            m_Renderer = GetComponentsInChildren <Renderer>();
            foreach (Renderer _renderer in m_Renderer)
            {
                RenderData _data = new RenderData();

                _data.renderer  = _renderer;
                _data.ID        = _renderer.GetInstanceID();
                _data.materials = _renderer.materials;

                m_RenderDatas.Add(_data);
            }
        }
        internal override bool Reconstruct(BlamLib.Blam.CacheFile c)
        {
            bool result = true;

            // recreate the section data
            if (RenderData.Count != 1)
            {
                structure_bsp_cluster_data_block_new cdata;
                RenderData.Add(out cdata);

                result = cdata.Section.Value.Reconstruct(c, SectionInfo.Value, GeometryBlockInfo.Value);
            }

            GeometryBlockInfo.Value.ClearPostReconstruction();

            return(result);
        }
 public void Execute()
 {
     // SORT
     for (int i = 0; i < sortArray.Length; i++)
     {
         for (int j = i + 1; j < sortArray.Length; j++)
         {
             if (sortArray[i].position.y < sortArray[j].position.y)
             {
                 //SWAP
                 RenderData tmpData = sortArray[i];
                 sortArray[i] = sortArray[j];
                 sortArray[j] = tmpData;
             }
         }
     }
 }
        private static void SwapChainPanel_Unloaded(object sender, RoutedEventArgs e)
        {
            SwapChainPanel swapChainPanel = sender as SwapChainPanel;

            if (swapChainPanel == null)
            {
                return;
            }

            Debug.WriteLine($"{nameof(SwapChainPanelPainter)}.{nameof(SwapChainPanel_Unloaded)} swapChainPanel={swapChainPanel}");

            swapChainPanel.Loaded                  -= SwapChainPanel_Loaded;
            swapChainPanel.Unloaded                -= SwapChainPanel_Unloaded;
            swapChainPanel.SizeChanged             -= SwapChainPanel_SizeChanged;
            swapChainPanel.CompositionScaleChanged -= SwapChainPanel_CompositionScaleChanged;

            RenderData.Dispose(swapChainPanel);
        }
Exemple #30
0
        public override void Paint(RenderData AData)
        {
            void DoPaint(GdiPlusPainter painter, RectangleF bounds)
            {
                ControlPaint.DrawButton(painter.Canvas, Rectangle.Round(bounds), ButtonState.Normal);
                painter.SetHorizontalAlign(HorizontalAlign.Center);
                painter.TextOut(bounds, "Button Text");
            }

            if (string.IsNullOrEmpty(AData.Data))
            {
                DoPaint((GdiPlusPainter)AData.Painter, AData.Bounds);
            }
            else
            {
                base.Paint(AData);
            }
        }
Exemple #31
0
 private void Button1_Click(object sender, EventArgs e)
 {
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         try
         {
             Parser     parser = new Parser(openFileDialog1.FileName);
             RenderData RData  = parser.Parse();
             Render     R      = new Render(RData);
             R.RenderAll(/*path to PNG file*/);
             MessageBox.Show("Image.png", "Image successfully creted", MessageBoxButtons.OK);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
 public bool DeepEquals(DestinyCharacterResponse?other)
 {
     return(other is not null &&
            (Inventory is not null ? Inventory.DeepEquals(other.Inventory) : other.Inventory is null) &&
            (Character is not null ? Character.DeepEquals(other.Character) : other.Character is null) &&
            (Progressions is not null ? Progressions.DeepEquals(other.Progressions) : other.Progressions is null) &&
            (RenderData is not null ? RenderData.DeepEquals(other.RenderData) : other.RenderData is null) &&
            (Activities is not null ? Activities.DeepEquals(other.Activities) : other.Activities is null) &&
            (Equipment is not null ? Equipment.DeepEquals(other.Equipment) : other.Equipment is null) &&
            (Kiosks is not null ? Kiosks.DeepEquals(other.Kiosks) : other.Kiosks is null) &&
            (PlugSets is not null ? PlugSets.DeepEquals(other.PlugSets) : other.PlugSets is null) &&
            (PresentationNodes is not null ? PresentationNodes.DeepEquals(other.PresentationNodes) : other.PresentationNodes is null) &&
            (Records is not null ? Records.DeepEquals(other.Records) : other.Records is null) &&
            (Collectibles is not null ? Collectibles.DeepEquals(other.Collectibles) : other.Collectibles is null) &&
            (ItemComponents is not null ? ItemComponents.DeepEquals(other.ItemComponents) : other.ItemComponents is null) &&
            (UninstancedItemComponents is not null ? UninstancedItemComponents.DeepEquals(other.UninstancedItemComponents) : other.UninstancedItemComponents is null) &&
            (CurrencyLookups is not null ? CurrencyLookups.DeepEquals(other.CurrencyLookups) : other.CurrencyLookups is null));
 }
    public void Test_RenderData_TitleEqualsPageTitleIfExists()
    {
        var siteInfo = new SiteInfo();
        var file     = new Kaylumah.Ssg.Manager.Site.Service.Files.Processor.File()
        {
            MetaData = new FileMetaData {
                { "title", "1" }
            }
        };
        var PageMetaData = file.ToPage();
        var SiteMetaData = new SiteMetaData(new PageMetaData[] { PageMetaData });
        var sut          = new RenderData {
            Site = SiteMetaData, Page = PageMetaData
        };

        sut.Should().NotBeNull();
        sut.Title.Should().Be("1");
    }
Exemple #34
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RenderControl" /> class.
        /// </summary>
        public RenderControl()
        {
            SetStyle(ControlStyles.ResizeRedraw, true);

            renderColors = ColorManager.Default();

            this.BackColor = renderColors.Background;

            zoom = new Zoom(true);
            context = new BufferedGraphicsContext();
            data = new RenderData();

            timer = new Timer();
            timer.Interval = 3000;
            timer.Tick += (sender, e) =>
            {
                timer.Stop();
                coordinate = String.Empty;
                this.Invalidate();
            };
        }
Exemple #35
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MeshRenderer" /> class.
        /// </summary>
        public MeshRenderer(RenderData data, ColorManager renderColors)
        {
            this.data = data;
            this.renderColors = renderColors;

            int featureCount = data.Points.Length;

            if (data.MeshEdges != null)
            {
                featureCount += data.MeshEdges.Length;
            }
            else if (data.Triangles != null)
            {
                featureCount += 2 * data.Triangles.Length;
            }

            this.ignoreBounds = featureCount < 1000;

            if (data.Triangles != null && data.NumberOfRegions > 0)
            {
                renderColors.MakeRegionMap(data.TrianglePartition, data.NumberOfRegions);
            }
        }
Exemple #36
0
 public Renderer(RenderData renderData)
 {
     m_renderData = renderData;
 }
Exemple #37
0
 public void SendMapData(RenderData<RenderTile> mapData, int columns, int rows)
 {
     m_pixelShader.SendMapData(mapData, columns, rows);
 }
Exemple #38
0
        protected override void OnInitialized(EventArgs e)
        {
            m_renderData = new RenderData();

            m_renderer = new Renderer(m_renderData);

            this.GridSizeChanged += MapControl_GridSizeChanged;
            this.ScreenCenterPosChanged += MapControl_ScreenCenterPosChanged;

            base.OnInitialized(e);

            base.ScreenCenterPos = new DoubleVector3(19, 12, 0);
        }
Exemple #39
0
        /// <summary>
        /// Updates the displayed input data.
        /// </summary>
        public void SetData(RenderData data)
        {
            this.data = data;

            meshRenderer = new MeshRenderer(data, renderColors);

            this.showVoronoi = data.VoronoiPoints != null;

            if (showVoronoi)
            {
                voronoiRenderer = new VoronoiRenderer(data);
            }

            // Reset the zoom on new data
            zoom.Initialize(this.ClientRectangle, data.Bounds);

            initialized = true;

            this.Render();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="VoronoiRenderer" /> class.
 /// </summary>
 public VoronoiRenderer(RenderData data)
 {
     this.data = data;
 }