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

Function initGL

cpp/5_Domain_Specific/fluidsGL/fluidsGL.cpp:361–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}
360
361int initGL(int *argc, char **argv)
362{
363 glutInit(argc, argv);
364 glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
365 glutInitWindowSize(wWidth, wHeight);
366 glutCreateWindow("Compute Stable Fluids");
367 glutDisplayFunc(display);
368 glutKeyboardFunc(keyboard);
369 glutMouseFunc(click);
370 glutMotionFunc(motion);
371 glutReshapeFunc(reshape);
372
373 if (!isGLVersionSupported(1, 5)) {
374 fprintf(stderr, "ERROR: Support for OpenGL 1.5 is missing");
375 fflush(stderr);
376 return false;
377 }
378
379 if (!areGLExtensionsSupported("GL_ARB_vertex_buffer_object")) {
380 fprintf(stderr, "ERROR: Support for necessary OpenGL extensions missing.");
381 fflush(stderr);
382 return false;
383 }
384
385 return true;
386}
387
388int main(int argc, char **argv)
389{

Callers 1

mainFunction · 0.70

Calls 2

isGLVersionSupportedFunction · 0.85
areGLExtensionsSupportedFunction · 0.85

Tested by

no test coverage detected