/////////////////////////////////////////////////////////////////////////// render a simple 3D scene ///////////////////////////////////////////////////////////////////////////
| 323 | //! render a simple 3D scene |
| 324 | //////////////////////////////////////////////////////////////////////////////// |
| 325 | void 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 |
| 357 | void processImage() |