glutSetOption closes app

Started by
-1 comments, last by aerlfredith 11 years, 9 months ago
Hi,

When running my app it just stops.
With breakpoints i found that

glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION);

closes my app although i believe this has no reson of happening, if i just do not call this everything works ok.
for the sake of understanding open gl i would like to ask if anyone knew of a reason this function would be causing this

thanks,


before quitting the app outputs that i havent called glutInit before setoptions,
but below is my code



glutInit(&argc, argv);

int width = 500;
int height = 500;
unsigned int displayMode = GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH | GLUT_STENCIL;
displayMode = defaults(displayMode, width, height);

glutInitDisplayMode (displayMode);
glutInitContextVersion (3, 3);
glutInitContextProfile(GLUT_CORE_PROFILE);
#ifdef _DEBUG
glutInitContextFlags(GLUT_DEBUG);
#endif
glutInitWindowSize (width, height);
glutInitWindowPosition (300, 200);
int window = glutCreateWindow (argv[0]);

glload::LoadFunctions();

glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION);

if(!glload::IsVersionGEQ(3, 3))
{
printf("Your OpenGL version is %i, %i. You must have at least OpenGL 3.3 to run this tutorial.\n",
glload::GetMajorVersion(), glload::GetMinorVersion());
glutDestroyWindow(window);
return 0;
}

if(glext_ARB_debug_output)
{
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
glDebugMessageCallbackARB(DebugFunc, (void*)15);
}

init();

glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutMainLoop();
return 0;

This topic is closed to new replies.

Advertisement