If I have a main function like this:
int main(int argc, char **argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize (800, 600);
glutInitWindowPosition (100, 100);
glutCreateWindow ("A");
init();
glutIdleFunc(update);
glutDisplayFunc(draw);
glutReshapeFunc(resize);
glutKeyboardFunc(keyboard);
glutSpecialFunc(specialKeyboard);
glutMouseFunc(mouse);
cout<<x<<" "<<"Printed out variable x"<<endl;
cout<<y<<" "<<"Printed out variable y"<<endl;
cout<<z<<" "<<"Printed out variable z"<<endl;
glutMainLoop();
return 0;
}
Where can I see the result of the cout calls?
If you’re working in a Console Application Project, then the output should appear on the console (the command prompt-like window that opens with the OpenGL window).
If you are not working in a Console Application, and you have a Win32 or Empty project instead, then you will have to set the subsystem linker flag to CONSOLE, as mkaes pointed out in his comment. To do so (in Visual Studio 2010):