MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / display

Function display

cpp/0_Introduction/simpleTexture3D/simpleTexture3D.cpp:152–173  ·  view source on GitHub ↗

display results using OpenGL (called by GLUT)

Source from the content-addressed store, hash-verified

150
151// display results using OpenGL (called by GLUT)
152void display()
153{
154 sdkStartTimer(&timer);
155
156 render();
157
158 // display results
159 glClear(GL_COLOR_BUFFER_BIT);
160
161 // draw image from PBO
162 glDisable(GL_DEPTH_TEST);
163 glRasterPos2i(0, 0);
164 glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo);
165 glDrawPixels(width, height, GL_RGBA, GL_UNSIGNED_BYTE, 0);
166 glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
167
168 glutSwapBuffers();
169 glutReportErrors();
170
171 sdkStopTimer(&timer);
172 computeFPS();
173}
174
175void idle()
176{

Callers

nothing calls this directly

Calls 4

sdkStartTimerFunction · 0.85
sdkStopTimerFunction · 0.85
renderFunction · 0.70
computeFPSFunction · 0.70

Tested by

no test coverage detected