//-------------------------------------------------------------- void ofApp::keyPressed(int key){ if (key == ' '){ // todo: rewrite this with ofLog: FILE *fp; if((fp=freopen(ofToDataPath("openglReport.txt").c_str(), "w" ,stdout))==NULL) { cout << "Cannot open file.\n"; return; } cout << "-------------------------------------------------\n"; cout << "opengl info\n"; cout << "-------------------------------------------------\n"; printGLInfo(); cout << "-------------------------------------------------\n"; cout << "opengl limits\n"; cout << "-------------------------------------------------\n"; print_limits(); cout << "-------------------------------------------------\n"; cout << "shader limits\n"; cout << "-------------------------------------------------\n"; printShaderLimits(); cout << "-------------------------------------------------\n"; cout << "available extensions\n"; cout << "-------------------------------------------------\n"; const GLubyte * strExt; strExt = glGetString (GL_EXTENSIONS); //cout << "extensions: " << strExt << endl; print_extension_list((char *)strExt); //isShade = gluCheckExtension ((const GLubyte*)"GL_ARB_shading_language_100", strExt); cout << "-------------------------------------------------\n"; cout << "opengl calls available\n"; cout << "-------------------------------------------------\n"; printGlewInfo(); fclose(fp); #ifdef TARGET_WIN32 string command = "start " + ofToString(ofToDataPath("openglReport.txt").c_str()); #elif defined(TARGET_LINUX) string command = "xdg-open " + ofToString(ofToDataPath("openglReport.txt").c_str()); #else string command = "open " + ofToString(ofToDataPath("openglReport.txt").c_str()); #endif if (0 != system(command.c_str())){ ofLogWarning() << "Command " << command.c_str() << " did not return 0. Something may have gone wrong."; } } }
//-------------------------------------------------------------- void testApp::keyPressed(int key){ if (key == ' '){ // todo: rewrite this with ofLog: FILE *fp; if((fp=freopen(ofToDataPath("openglReport.txt").c_str(), "w" ,stdout))==NULL) { printf("Cannot open file.\n"); return; } printf("-------------------------------------------------\n"); printf("opengl info\n"); printf("-------------------------------------------------\n"); printGLInfo(); printf("-------------------------------------------------\n"); printf("opengl limits\n"); printf("-------------------------------------------------\n"); print_limits(); printf("-------------------------------------------------\n"); printf("shader limits\n"); printf("-------------------------------------------------\n"); printShaderLimits(); printf("-------------------------------------------------\n"); printf("available extensions\n"); printf("-------------------------------------------------\n"); const GLubyte * strExt; strExt = glGetString (GL_EXTENSIONS); //cout << "extensions: " << strExt << endl; print_extension_list((char *)strExt); //isShade = gluCheckExtension ((const GLubyte*)"GL_ARB_shading_language_100", strExt); printf("-------------------------------------------------\n"); printf("opengl calls available\n"); printf("-------------------------------------------------\n"); printGlewInfo(); fclose(fp); string command = "open " + ofToString(ofToDataPath("openglReport.txt").c_str()); system(command.c_str()); } }