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; }
/// <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(); }