Changeset 948 for trunk/source/visualization/OpenGL/src/G4OpenGLXViewer.cc
- Timestamp:
- Mar 23, 2009, 6:25:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/OpenGL/src/G4OpenGLXViewer.cc
r946 r948 49 49 #include "G4Point3D.hh" 50 50 #include "G4Normal3D.hh" 51 #include "G4StateManager.hh" 51 52 52 53 #include <X11/Xatom.h> … … 484 485 fGLXWin=glxpmap; 485 486 487 // 486 488 bool er1 = glXMakeCurrent (dpy, 487 489 fGLXWin, // pixmap win Id … … 490 492 glViewport (0, 0, fWinSize_x, fWinSize_y); 491 493 494 // InitializeGLView (); 495 496 // clear the buffers and window. 492 497 ClearView (); 493 SetView (); 498 SetView(); 499 // FinishView (); 500 494 501 #ifdef G4DEBUG_VIS_OGL 495 502 printf("G4OpenGLXViewer::print Call DrawView context:%d old winGL:%d \n",cx,fGLXWin); 496 503 #endif 497 DrawView (); 504 505 506 507 // Need to force redraw for SXm mode 508 NeedKernelVisit (); 509 510 // Need to change state to IDLE 511 G4StateManager* stateManager = G4StateManager::GetStateManager(); 512 G4ApplicationState oldState = stateManager->GetCurrentState(); 513 stateManager->SetNewState(G4State_Idle); 514 515 516 517 DrawView (); // Will make current glX 518 519 // Restore state 520 stateManager->SetNewState(oldState); 521 522 523 498 524 499 525 std::string file = "G4OpenGL_XPixmap.eps"; … … 511 537 printf("Error 1:%d 2:%d\n",er1,er2); 512 538 539 // glXDestroyContext(pcx); 540 // glXDestroyGLXPixmap(glpixmap) 513 541 } 514 542 … … 548 576 549 577 578 printf("------%d------\n",tmp_cx); 550 579 return glXCreateContext (dpy, 551 580 pvi, 552 tmp_cx,581 0, 553 582 False); 554 583 } … … 596 625 glReadPixels (0, 0, (GLsizei)width, (GLsizei)height, format, GL_UNSIGNED_BYTE, (GLvoid*) buffer); 597 626 598 // glXWaitGL (); //Wait for effects of all previous OpenGL commands to 599 // //be propagated before progressing. 600 // glFlush (); 601 for (int i = 0; i<size; i++) { 602 if (buffer[i] != 0) 603 printf("%d",buffer[i]); 604 // else 605 // printf("."); 606 } 627 glXWaitGL (); //Wait for effects of all previous OpenGL commands to 628 // //be propagated before progressing. 629 glFlush (); 607 630 608 631 // printf("-----------\n-----------\n-----------\n-----------\n-----------\n%d %d %d\n",width, height,size);
Note: See TracChangeset
for help on using the changeset viewer.