Jump to content

  • Log In with Google      Sign In   
  • Create Account

aerlfredith

Member Since 07 Jul 2012
Offline Last Active Jul 08 2012 07:55 AM

Topics I've Started

glutSetOption closes app

08 July 2012 - 03:37 AM

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;

freeglut linker errors

07 July 2012 - 05:09 PM

Hi,

I'm trying to install freeglut on my pc and my testApp gets linkers errors which even after severel tries to fix i have not been able to fix.
.lib and header are inside my VS directory/VC/lib and /VC/include, the dll is inside the windows directory and still i get


1>App.obj : error LNK2019: unresolved external symbol __imp__glutLeaveMainLoop@0 referenced in function "public: void __thiscall App::Keyboard(unsigned int,int,int)" (?Keyboard@App@@QAEXIHH@Z)
1>Main.obj : error LNK2019: unresolved external symbol __imp__glutSetOption@8 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glutInitContextProfile@4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glutInitContextVersion@8 referenced in function _main

the other glut fucntions used in normal glut (without the free) do NOT throw any errors

does anyone have any suggestions
Thanks

me :)

PARTNERS