コード例 #1
0
        void bedSizeChangedHandler(object o)
        {
            isLoadingBox = true;

            boxList = BoxCreator.createBox(Settings.bedWidth, Settings.bedLength, Settings.bedHeigth, boxColor);

            gridBuffer = new VertexBuffer(GraphicsDevice, typeof(VertexPositionColoredNormal), boxList.Count, BufferUsage.None);
            gridBuffer.SetData <VertexPositionColoredNormal>(boxList.ToArray());

            zoomLevel = 0;

            isLoadingBox = false;
        }
コード例 #2
0
        /// <summary>
        /// This function is used to load the grid box
        /// that represents the printbed.
        /// </summary>
        private void loadBox()
        {
            //return;
            new Thread(new ThreadStart(() =>
            {
                boxList = BoxCreator.createBox(Settings.bedWidth, Settings.bedLength, Settings.bedHeigth, boxColor);

                gridBuffer = new VertexBuffer(GraphicsDevice, typeof(VertexPositionColoredNormal), boxList.Count, BufferUsage.None);
                gridBuffer.SetData <VertexPositionColoredNormal>(boxList.ToArray());

                isLoadingBox = false;
            })).Start();
        }