public void render(IDisplay display) { this.display = display; display.imageBegin(imageWidth, imageHeight, bucketSize); // set members variables bucketCounter = 0; // start task Systems.Timer timer = new Systems.Timer(); timer.start(); UI.taskStart("Rendering", 0, bucketCoords.Length); BucketThread[] renderThreads = new BucketThread[scene.getThreads()]; for (int i = 0; i < renderThreads.Length; i++) { renderThreads[i] = new BucketThread(i, this); renderThreads[i].setPriority(scene.getThreadPriority()); renderThreads[i].start(); } for (int i = 0; i < renderThreads.Length; i++) { try { renderThreads[i].join(); } catch (Exception e) { UI.printError(UI.Module.BCKT, "Bucket processing thread {0} of {1} was interrupted", i + 1, renderThreads.Length); } finally { renderThreads[i].updateStats(); } } UI.taskStop(); timer.end(); UI.printInfo(UI.Module.BCKT, "Render time: {0}", timer.ToString()); display.imageEnd(); }
public void render(IDisplay display) { this.display = display; display.imageBegin(imageWidth, imageHeight, bucketSize); // set members variables bucketCounter = 0; // start task Systems.Timer timer = new Systems.Timer(); timer.start(); UI.taskStart("Rendering", 0, bucketCoords.Length); BucketThread[] renderThreads = new BucketThread[scene.getThreads()]; for (int i = 0; i < renderThreads.Length; i++) { renderThreads[i] = new BucketThread(i, this); renderThreads[i].setPriority(scene.getThreadPriority()); renderThreads[i].start(); } for (int i = 0; i < renderThreads.Length; i++) { try { renderThreads[i].join(); } catch (Exception e) { UI.printError(UI.Module.BCKT, "Bucket processing thread {0} of {1} was interrupted", i + 1, renderThreads.Length); } finally { renderThreads[i].updateStats(); } } UI.taskStop(); timer.end(); UI.printInfo(UI.Module.BCKT, "Render time: {0}", timer.ToString()); display.imageEnd(); }