Manta Interactive Ray Tracer Development Mailing List

Text archives Help


Re: [Manta] r2067 - trunk/StandAlone


Chronological Thread 
  • From: James Bigler <bigler@cs.utah.edu>
  • Cc: manta@sci.utah.edu
  • Subject: Re: [Manta] r2067 - trunk/StandAlone
  • Date: Fri, 15 Feb 2008 08:03:00 -0700

This is a good idea that has been long over due. Checked in with version 2074.

I also made unknown arguments throw errors.

James

On Feb 14, 2008, at 12:51 PM, Solomon Boulos wrote:

Why not throw an InputError if you get somewhere that you want to create a channel and one already exists? This seems more useful than silent "failure" and enforces the "one imagedisplay policy". While we're at it, maybe someone can refactor the way this works entirely and search for the resolution before the channel is ever created (if imagedisplay is specified before -res, you don't get that resolution). Then again, this new channelCreated bool actually allows us to throw an InputError in that case as well (if the channel is already created when they request a resolution, throw an InputError).



On Feb 14, 2008, at 11:53 AM, Thiago Ize wrote:

Author: thiago
Date: Thu Feb 14 12:53:45 2008
New Revision: 2067

Modified:
  trunk/StandAlone/manta.cc
Log:
Only allow the first -imagedisplay to count. Note this means that calling
 -imagedisplay opengl -nodisplaybench
will result in the benchmark actually displaying an image, but at
least it will be visually obvious to the user that something is
wrong. This also fixes the more insidious bug of
 -imagedisplay null -nodisplaybench
which causes manta to render twice, and so run twice as slow, without
any indication for why.

Perhaps it would be nice if someone were to write some more robust
parameter error checking and warn the user of all the invalid
arguments being passed in.

Modified: trunk/StandAlone/manta.cc
===================================================================== =========
--- trunk/StandAlone/manta.cc   (original)
+++ trunk/StandAlone/manta.cc   Thu Feb 14 12:53:45 2008
@@ -281,9 +281,12 @@

          if (arg.find("-nodisplaybench") == 0) {
            // setup the ui and imagedisplay to both be null
- ImageDisplay *display = factory->createImageDisplay ( "null" );
- rtrt->createChannel(display, currentCamera, stereo, xres, yres);
-            channelCreated=true;
+
+            if(!channelCreated) {
+ ImageDisplay *display = factory->createImageDisplay ( "null" );
+ rtrt->createChannel(display, currentCamera, stereo, xres, yres);
+              channelCreated=true;
+            }
            UserInterface* ui = factory->createUserInterface("null");
if (!ui) throw UnknownComponent( "Null user interface not found", "");
            ui->startup();
@@ -315,10 +318,11 @@

          // Create the channel.
          try {
- ImageDisplay *display = factory->createImageDisplay ( s );
-
- rtrt->createChannel(display, currentCamera, stereo, xres, yres);
+            if(!channelCreated) {
+ ImageDisplay *display = factory->createImageDisplay ( s );

+ rtrt->createChannel(display, currentCamera, stereo, xres, yres);
+            }

          } catch (UnknownComponent e) {
            cerr << e.message() << "\n"






Archive powered by MHonArc 2.6.16.

Top of page