Skip to content

Including NV Files

Devon Loehr edited this page Jun 14, 2019 · 2 revisions

NV programs allow other NV files to be included, in a way similar to the C/C++ #include directive. The syntax for this is

    include "example.nv"

File paths should be relative to the source file which contains the include statement.

For all practical purposes, the effect of an include directive is to replace that line of the program with the entire contents of the file "example.nv". This is done recursively, in order. We track which files have already been included to avoid circular (or repeated) includes -- no need for C-style header guards.

Finally, note that all includes must appear at the beginning of the program, before any other code.

Clone this wiki locally