-
Notifications
You must be signed in to change notification settings - Fork 3
/
snogray.cc
37 lines (31 loc) · 1.01 KB
/
snogray.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// snogray.cc -- Main driver for snogray ray tracer
//
// Copyright (C) 2011-2013 Miles Bader <miles@gnu.org>
//
// This source code is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3, or (at
// your option) any later version. See the file COPYING for more details.
//
// Written by Miles Bader <miles@gnu.org>
//
#include <string>
#include <cstring>
#include "lua/invoke-lua-driver.h"
int main (int, const char **argv)
{
std::string driver = "snogray.lua";
// An initial magic "--driver DRIVER_NAME" option replaces the name
// of the driver, and then invokes it with the option removed.
// [It's "magic" because it can only occur as the first option, and
// must be in exactly that form.]
//
if (argv[1] && strcmp (argv[1], "--driver") == 0)
{
driver = argv[2];
argv[2] = argv[0];
argv += 2;
}
snogray::invoke_lua_driver (driver, argv);
return 0;
}