MCPcopy Create free account
hub / github.com/RenderKit/ospray / main

Function main

apps/ospTutorial/ospTutorial.c:51–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51int main(int argc, const char **argv)
52{
53 // image size
54 int imgSize_x = 1024; // width
55 int imgSize_y = 768; // height
56
57 // camera
58 float cam_pos[] = {0.f, 0.f, 0.f};
59 float cam_up[] = {0.f, 1.f, 0.f};
60 float cam_view[] = {0.1f, 0.f, 1.f};
61
62 // triangle mesh data
63 float vertex[] = {-1.0f,
64 -1.0f,
65 3.0f,
66 -1.0f,
67 1.0f,
68 3.0f,
69 1.0f,
70 -1.0f,
71 3.0f,
72 0.1f,
73 0.1f,
74 0.3f};
75 float color[] = {0.9f,
76 0.5f,
77 0.5f,
78 1.0f,
79 0.8f,
80 0.8f,
81 0.8f,
82 1.0f,
83 0.8f,
84 0.8f,
85 0.8f,
86 1.0f,
87 0.5f,
88 0.9f,
89 0.5f,
90 1.0f};
91 int32_t index[] = {0, 1, 2, 1, 2, 3};
92
93#ifdef _WIN32
94 int waitForKey = 0;
95 CONSOLE_SCREEN_BUFFER_INFO csbi;
96 if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) {
97 // detect standalone console: cursor at (0,0)?
98 waitForKey = csbi.dwCursorPosition.X == 0 && csbi.dwCursorPosition.Y == 0;
99 }
100#endif
101
102 printf("initialize OSPRay...");
103
104 // initialize OSPRay; OSPRay parses (and removes) its commandline parameters,
105 // e.g. "--osp:debug"
106 OSPError init_error = ospInit(&argc, argv);
107 if (init_error != OSP_NO_ERROR)
108 return init_error;

Callers

nothing calls this directly

Calls 15

ospInitFunction · 0.85
ospNewCameraFunction · 0.85
ospSetFloatFunction · 0.85
ospSetParamFunction · 0.85
ospCommitFunction · 0.85
ospNewGeometryFunction · 0.85
ospNewSharedData1DFunction · 0.85
ospSetObjectFunction · 0.85
ospReleaseFunction · 0.85
ospNewMaterialFunction · 0.85
ospNewGeometricModelFunction · 0.85
ospSetObjectAsDataFunction · 0.85

Tested by

no test coverage detected