Skip to content

Commit

Permalink
fix C tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffamstutz committed Feb 2, 2023
1 parent f6b7df2 commit 2726472
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions examples/simple/anariTutorial.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ int main(int argc, const char **argv)

printf("initialize ANARI...");

// Use the 'example' library here, this is where the impl(s) come from
ANARILibrary lib = anariLoadLibrary("example", statusFunc, NULL);
// Use the 'helide' library here, this is where the impl(s) come from
ANARILibrary lib = anariLoadLibrary("helide", statusFunc, NULL);

// query available devices
const char **devices = anariGetDeviceSubtypes(lib);
Expand All @@ -150,30 +150,22 @@ int main(int argc, const char **argv)
}

puts("Available renderers:");
int havePt = 0;
for (const char **r = renderers; *r != NULL; r++) {
for (const char **r = renderers; *r != NULL; r++)
printf(" - %s\n", *r);
if (strcmp(*r, "pathtracer") == 0)
havePt = 1;
}
if (!havePt) {
puts("No pathtracer available!");
return 1;
}

// inspect default renderer parameters
const ANARIParameter *ptParams = anariGetObjectInfo(lib,
const ANARIParameter *rendererParams = anariGetObjectInfo(lib,
"default",
"default",
ANARI_RENDERER,
"parameter",
ANARI_PARAMETER_LIST);

if (!ptParams) {
if (!rendererParams) {
puts("Default renderer has no parameters.");
} else {
puts("Parameters of default renderer:");
for (const ANARIParameter *p = ptParams; p->name != NULL; p++) {
for (const ANARIParameter *p = rendererParams; p->name != NULL; p++) {
const char *desc = anariGetParameterInfo(lib,
"default",
"default",
Expand Down

0 comments on commit 2726472

Please sign in to comment.