Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix C tutorial #88

Merged
merged 1 commit into from
Feb 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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