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

Function renderScene

cpp/5_Domain_Specific/postProcessGL/main.cpp:325–354  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// render a simple 3D scene ///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

323//! render a simple 3D scene
324////////////////////////////////////////////////////////////////////////////////
325void renderScene(bool colorScale)
326{
327 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
328
329 if (colorScale) {
330 glUseProgram(shDrawPot);
331 glBindFragDataLocationEXT(shDrawPot, 0, "FragColor");
332 SDK_CHECK_ERROR_GL();
333 }
334
335 glMatrixMode(GL_MODELVIEW);
336 glLoadIdentity();
337 glTranslatef(0.0, 0.0, -3.0);
338 glRotatef(rotate[0], 1.0, 0.0, 0.0);
339 glRotatef(rotate[1], 0.0, 1.0, 0.0);
340 glRotatef(rotate[2], 0.0, 0.0, 1.0);
341
342 glViewport(0, 0, 512, 512);
343
344 glEnable(GL_LIGHTING);
345 glEnable(GL_DEPTH_TEST);
346
347 glutSolidTeapot(1.0);
348
349 if (colorScale) {
350 glUseProgram(0);
351 }
352
353 SDK_CHECK_ERROR_GL();
354}
355
356// copy image and process using CUDA
357void processImage()

Callers 1

displayFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected