Changeset 2677 for GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Timestamp:
- 05/14/08 19:06:06 (16 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2676 r2677 70 70 71 71 72 void QtGlRendererBuffer::Make Current()72 void QtGlRendererBuffer::MakeLive() 73 73 { 74 74 QGLPixelBuffer::makeCurrent(); … … 77 77 78 78 79 void QtGlRendererBuffer::Done Current()79 void QtGlRendererBuffer::DoneLive() 80 80 { 81 81 QGLPixelBuffer::doneCurrent(); … … 92 92 QGL::DepthBuffer | 93 93 QGL::DoubleBuffer | 94 QGL::Rgba 95 ) ),94 QGL::Rgba) 95 ), 96 96 GlRendererBuffer(sceneGraph, viewcells, tree) 97 97 { … … 99 99 //mUseVbos = false; 100 100 101 Make Current();101 MakeLive(); 102 102 glViewport(0, 0, w, h); 103 103 glMatrixMode(GL_PROJECTION); … … 109 109 110 110 InitGL(); 111 DoneCurrent(); 111 112 //mydynamicTexture = generateDynamicTexture(); 113 // bind the dynamic texture to the pbuffer - this is a no-op under X11 114 //bindToDynamicTexture(mydynamicTexture); 115 116 DoneLive(); 112 117 } 113 118 … … 133 138 float QtGlRendererBuffer::GetPixelError(int &pvsSize) 134 139 { 135 Make Current();140 MakeLive(); 136 141 137 142 if (0) … … 141 146 cout << "rgba: " << format().rgba() << endl; 142 147 cout << "double: " << format().doubleBuffer() << endl; 148 cout << "depth: " << format().depth() << endl; 149 cout << "gl:" << format().hasOpenGL() << endl; 150 cout << "dir:" << format().directRendering() << endl; 143 151 } 144 152 … … 249 257 pixelCount = query->GetQueryResult(); 250 258 251 pErrorPixels = ((float)pixelCount) / (GetWidth() * GetHeight()); 252 259 pErrorPixels = (float)pixelCount / (GetWidth() * GetHeight()); 260 261 // some error happened 253 262 if (pixelCount > 0) 254 263 { … … 265 274 266 275 char filename[256]; 267 sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); 276 //sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); 277 sprintf(filename, "error-frame-%04d-%04d.png", mFrame, pixelCount); 268 278 QImage im = toImage(); 269 279 string str = mSnapPrefix + filename; … … 306 316 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 307 317 308 Done Current();318 DoneLive(); 309 319 310 320 return pErrorPixels; … … 2399 2409 // bind the dynamic texture to the pbuffer - this is a no-op under X11 2400 2410 mRenderBuffer->bindToDynamicTexture(dynamicTexture); 2401 makeCurrent();2411 //makeCurrent(); 2402 2412 } 2403 2413 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2671 r2677 61 61 ~QtGlRendererBuffer() {} 62 62 63 virtual void Make Current();64 virtual void Done Current();63 virtual void MakeLive(); 64 virtual void DoneLive(); 65 65 66 66 virtual int GetWidth() const { return width(); } … … 75 75 int ComputePvs(ObjectContainer &objects, ObjectContainer &pvs) const; 76 76 77 unsigned int mydynamicTexture; 77 78 78 79 public: … … 311 312 312 313 public slots: 313 void UpdateDynamicObjects(); 314 315 void UpdateDynamicObjects(); 314 316 void UpdateAllPvs(); 315 317 void ComputeVisibility(); … … 516 518 mShowDistribution ^= 1; 517 519 518 std::cout << "b: " << (mShowDistribution & 1) << " " << (mShowDistribution & 2) << " " << (mShowDistribution & 4) << " " << (mShowDistribution & 8) << std::endl; 520 std::cout << "b: " 521 << (mShowDistribution & 1) << " " 522 << (mShowDistribution & 2) << " " 523 << (mShowDistribution & 4) << " " 524 << (mShowDistribution & 8) << std::endl; 519 525 } 520 526
Note: See TracChangeset
for help on using the changeset viewer.