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

Function reshape

cpp/5_Domain_Specific/volumeRender/volumeRender.cpp:371–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369int iDivUp(int a, int b) { return (a % b != 0) ? (a / b + 1) : (a / b); }
370
371void reshape(int w, int h)
372{
373 width = w;
374 height = h;
375 initPixelBuffer();
376
377 // calculate new grid size
378 gridSize = dim3(iDivUp(width, blockSize.x), iDivUp(height, blockSize.y));
379
380 glViewport(0, 0, w, h);
381
382 glMatrixMode(GL_MODELVIEW);
383 glLoadIdentity();
384
385 glMatrixMode(GL_PROJECTION);
386 glLoadIdentity();
387 glOrtho(0.0, 1.0, 0.0, 1.0, 0.0, 1.0);
388}
389
390void cleanup()
391{

Callers

nothing calls this directly

Calls 2

initPixelBufferFunction · 0.70
iDivUpFunction · 0.70

Tested by

no test coverage detected