00001 00002 /* 00003 pbrt source code Copyright(c) 1998-2007 Matt Pharr and Greg Humphreys. 00004 00005 This file is part of pbrt. 00006 00007 pbrt is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. Note that the text contents of 00011 the book "Physically Based Rendering" are *not* licensed under the 00012 GNU GPL. 00013 00014 pbrt is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with this program. If not, see <http://www.gnu.org/licenses/>. 00021 00022 */ 00023 00024 // pbrt.cpp* 00025 #include "pbrt.h" 00026 #include "api.h" 00027 // main program 00028 int main(int argc, char *argv[]) { 00029 // Print welcome banner 00030 printf("pbrt version %1.3f of %s at %s\n", 00031 PBRT_VERSION, __DATE__, __TIME__); 00032 printf("Copyright (c)1998-2007 Matt Pharr and " 00033 "Greg Humphreys.\n"); 00034 printf("The source code to pbrt (but *not* the contents of the book) is\n"); 00035 printf("covered by the GNU General Public License. See the file COPYING.txt\n"); 00036 printf("for the conditions of the license.\n"); 00037 fflush(stdout); 00038 pbrtInit(); 00039 // Process scene description 00040 if (argc == 1) { 00041 // Parse scene from standard input 00042 ParseFile("-"); 00043 } else { 00044 // Parse scene from input files 00045 for (int i = 1; i < argc; i++) 00046 if (!ParseFile(argv[i])) 00047 Error("Couldn't open scene file \"%s\"\n", argv[i]); 00048 } 00049 pbrtCleanup(); 00050 return 0; 00051 }