- Timestamp:
- 01/04/06 15:07:05 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.cpp
r494 r496 8 8 #include <GL/glext.h> 9 9 10 GlRenderer *renderer= NULL;10 GlRendererWidget *rendererWidget = NULL; 11 11 12 12 #ifdef _WIN32 … … 18 18 19 19 GlRenderer::GlRenderer(SceneGraph *sceneGraph, 20 ViewCellsManager *viewCellsManager): 21 QGLWidget(), 20 ViewCellsManager *viewCellsManager): 22 21 mSceneGraph(sceneGraph), 23 22 mViewCellsManager(viewCellsManager) … … 26 25 mViewPoint = mSceneGraph->GetBox().Center(); 27 26 mViewDirection = Vector3(0,0,1); 28 mRender = true;29 30 27 // timerId = startTimer(10); 31 28 mFrame = 0; 32 mPvsStatFrames = 10000;33 mPvsErrorBuffer.resize(mPvsStatFrames);34 ClearErrorBuffer();35 pbuffer = NULL;36 29 } 37 30 38 31 GlRenderer::~GlRenderer() 39 32 { 40 if (pbuffer)41 delete pbuffer;42 33 } 43 34 … … 101 92 102 93 void 103 GlRenderer:: initializeGL()94 GlRenderer::InitGL() 104 95 { 105 96 glMatrixMode(GL_PROJECTION); … … 124 115 } 125 116 126 void127 GlRenderer::resizeGL(int w, int h)128 {129 SetupProjection(w, h);130 131 if (pbuffer == NULL || pbuffer->size().width() != w || pbuffer->size().height() != h) {132 if (pbuffer)133 delete pbuffer;134 pbuffer = new QGLPixelBuffer(QSize(w,h));135 }136 137 updateGL();138 }139 117 140 118 … … 182 160 } 183 161 184 void 185 GlRenderer::paintGL() 186 { 187 if (mRender) { 188 Render(); 189 mFrame++; 190 } 191 } 192 193 void 194 GlRenderer::ClearErrorBuffer() 195 { 196 for (int i=0; i < mPvsStatFrames; i++) { 197 mPvsErrorBuffer[i] = 1.0f; 198 } 199 } 200 201 void 202 GlRenderer::EvalPvsStat() 203 { 204 mPvsStat.Reset(); 205 halton.Reset(); 206 207 pbuffer->makeCurrent(); 208 initializeGL(); 209 SetupProjection(pbuffer->size().width(), pbuffer->size().height()); 210 211 for (int i=0; i < mPvsStatFrames; i++) { 212 float err; 213 RandomViewPoint(); 214 if (mPvsErrorBuffer[i] > 0.0f) { 215 mPvsErrorBuffer[i] = GetPixelError(); 216 cout<<"("<<i<<","<<mPvsErrorBuffer[i]<<")"; 217 // swapBuffers(); 162 163 float 164 GlRenderer::GetPixelError() 165 { 166 float pErrorPixels = -1.0f; 167 168 glReadBuffer(GL_BACK); 169 170 mUseFalseColors = true; 171 172 SetupCamera(); 173 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 174 glEnable( GL_CULL_FACE ); 175 176 RenderScene(); 177 178 // now check whether any backfacing polygon would pass the depth test 179 static int query = -1; 180 if (query == -1) 181 glGenOcclusionQueriesNV(1, (unsigned int *)&query); 182 183 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 184 glDepthMask(GL_FALSE); 185 glDisable( GL_CULL_FACE ); 186 187 glBeginOcclusionQueryNV(query); 188 189 RenderScene(); 190 191 glEndOcclusionQueryNV(); 192 193 // at this point, if possible, go and do some other computation 194 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 195 glDepthMask(GL_TRUE); 196 glEnable( GL_CULL_FACE ); 197 198 unsigned int pixelCount; 199 // reenable other state 200 glGetOcclusionQueryuivNV(query, 201 GL_PIXEL_COUNT_NV, 202 &pixelCount); 203 204 if (pixelCount > 0) 205 return -1.0f; // backfacing polygon found -> not a valid viewspace sample 206 207 ViewCell *viewcell = mViewCellsManager->GetViewCell(mViewPoint); 208 209 if (viewcell) { 210 SetupCamera(); 211 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 212 213 // Render PVS 214 std::map<Intersectable *, 215 PvsData<Intersectable *>, 216 LtSample<Intersectable *> >::const_iterator it = viewcell->GetPvs().mEntries.begin(); 217 218 for (; it != viewcell->GetPvs().mEntries.end(); ++ it) { 219 Intersectable *object = (*it).first; 220 RenderIntersectable(object); 218 221 } 219 220 err = mPvsErrorBuffer[i]; 221 222 if (err >= 0.0f) { 223 if (err > mPvsStat.maxError) 224 mPvsStat.maxError = err; 225 mPvsStat.sumError += err; 226 if (err == 0.0f) 227 mPvsStat.errorFreeFrames++; 228 mPvsStat.frames++; 229 } 230 } 231 232 pbuffer->doneCurrent(); 233 234 cout<<endl<<flush; 235 mRenderingFinished.wakeAll(); 236 } 222 223 glBeginOcclusionQueryNV(query); 224 225 SetupCamera(); 226 227 RenderScene(); 228 229 glEndOcclusionQueryNV(); 230 231 232 unsigned int pixelCount; 233 // reenable other state 234 glGetOcclusionQueryuivNV(query, 235 GL_PIXEL_COUNT_NV, 236 &pixelCount); 237 238 pErrorPixels = (100.f*pixelCount)/(GetWidth()*GetHeight()); 239 } 240 241 return pErrorPixels; 242 } 243 237 244 238 245 float 239 GlRenderer ::Render()246 GlRendererWidget::RenderErrors() 240 247 { 241 248 float pErrorPixels = -1.0f; … … 346 353 return pErrorPixels; 347 354 } 355 348 356 349 357 void … … 363 371 } 364 372 365 float 366 GlRenderer::GetPixelError() 367 { 368 float pErrorPixels = -1.0f; 369 370 glReadBuffer(GL_BACK); 371 372 mUseFalseColors = true; 373 374 SetupCamera(); 375 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 376 glEnable( GL_CULL_FACE ); 377 378 RenderScene(); 379 380 // now check whether any backfacing polygon would pass the depth test 381 static int query = -1; 382 if (query == -1) 383 glGenOcclusionQueriesNV(1, (unsigned int *)&query); 384 385 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 386 glDepthMask(GL_FALSE); 387 glDisable( GL_CULL_FACE ); 388 389 glBeginOcclusionQueryNV(query); 390 391 RenderScene(); 392 393 glEndOcclusionQueryNV(); 394 395 // at this point, if possible, go and do some other computation 396 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 397 glDepthMask(GL_TRUE); 398 glEnable( GL_CULL_FACE ); 399 400 unsigned int pixelCount; 401 // reenable other state 402 glGetOcclusionQueryuivNV(query, 403 GL_PIXEL_COUNT_NV, 404 &pixelCount); 405 406 if (pixelCount > 0) 407 return -1.0f; // backfacing polygon found -> not a valid viewspace sample 408 409 ViewCell *viewcell = mViewCellsManager->GetViewCell(mViewPoint); 410 411 if (viewcell) { 412 SetupCamera(); 413 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 414 415 // Render PVS 416 std::map<Intersectable *, 417 PvsData<Intersectable *>, 418 LtSample<Intersectable *> >::const_iterator it = viewcell->GetPvs().mEntries.begin(); 419 420 for (; it != viewcell->GetPvs().mEntries.end(); ++ it) { 421 Intersectable *object = (*it).first; 422 RenderIntersectable(object); 373 374 void 375 GlRendererBuffer::ClearErrorBuffer() 376 { 377 for (int i=0; i < mPvsStatFrames; i++) { 378 mPvsErrorBuffer[i] = 1.0f; 379 } 380 } 381 382 383 void 384 GlRendererBuffer::EvalPvsStat() 385 { 386 mPvsStat.Reset(); 387 halton.Reset(); 388 389 makeCurrent(); 390 391 SetupProjection(GetWidth(), GetHeight()); 392 393 for (int i=0; i < mPvsStatFrames; i++) { 394 float err; 395 RandomViewPoint(); 396 if (mPvsErrorBuffer[i] > 0.0f) { 397 mPvsErrorBuffer[i] = GetPixelError(); 398 cout<<"("<<i<<","<<mPvsErrorBuffer[i]<<")"; 399 // swapBuffers(); 423 400 } 424 425 glBeginOcclusionQueryNV(query);426 427 SetupCamera();428 429 RenderScene();430 431 glEndOcclusionQueryNV();432 433 434 unsigned int pixelCount;435 // reenable other state 436 glGetOcclusionQueryuivNV(query, 437 GL_PIXEL_COUNT_NV, 438 &pixelCount); 439 440 pErrorPixels = (100.f*pixelCount)/(height()*width());441 442 443 return pErrorPixels; 444 } 445 446 447 void 448 GlRenderer ::mousePressEvent(QMouseEvent *e)401 402 err = mPvsErrorBuffer[i]; 403 404 if (err >= 0.0f) { 405 if (err > mPvsStat.maxError) 406 mPvsStat.maxError = err; 407 mPvsStat.sumError += err; 408 if (err == 0.0f) 409 mPvsStat.errorFreeFrames++; 410 mPvsStat.frames++; 411 } 412 } 413 414 doneCurrent(); 415 416 cout<<endl<<flush; 417 mRenderingFinished.wakeAll(); 418 } 419 420 421 422 423 424 void 425 GlRendererWidget::mousePressEvent(QMouseEvent *e) 449 426 { 450 427 int x = e->pos().x(); … … 457 434 458 435 void 459 GlRenderer ::mouseMoveEvent(QMouseEvent *e)436 GlRendererWidget::mouseMoveEvent(QMouseEvent *e) 460 437 { 461 438 float MOVE_SENSITIVITY = Magnitude(mSceneGraph->GetBox().Diagonal())*1e-3; … … 485 462 486 463 void 487 GlRenderer::mouseReleaseEvent(QMouseEvent *) 488 { 489 490 491 } 464 GlRendererWidget::mouseReleaseEvent(QMouseEvent *) 465 { 466 467 468 } 469 470 void 471 GlRendererWidget::resizeGL(int w, int h) 472 { 473 SetupProjection(w, h); 474 updateGL(); 475 } 476 477 void 478 GlRendererWidget::paintGL() 479 { 480 RenderErrors(); 481 mFrame++; 482 } -
trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.h
r494 r496 38 38 }; 39 39 40 class GlRenderer : public QGLWidget 40 41 /** Class encapsulating gl rendering for the scene. 42 There is no gl context binding so the binding is performed in the 43 derived classes 44 */ 45 46 class GlRenderer 41 47 { 42 Q_OBJECT 48 43 49 public: 44 50 SceneGraph *mSceneGraph; … … 50 56 51 57 int timerId; 52 Vector3 mousePoint;53 58 bool mUseFalseColors; 54 59 55 60 HaltonSequence halton; 56 61 57 bool mRender;58 62 int mFrame; 59 60 int mPvsStatFrames;61 vector<float> mPvsErrorBuffer;62 63 PvsRenderStatistics mPvsStat;64 63 65 64 QWaitCondition mRenderingFinished; 66 67 QGLPixelBuffer *pbuffer;68 65 69 66 70 67 GlRenderer(SceneGraph *sceneGraph, 71 72 68 ViewCellsManager *viewcells); 69 73 70 ~GlRenderer(); 74 71 72 75 73 void SetupFalseColor(const int id); 76 77 74 void RenderIntersectable(Intersectable *); 78 75 void RenderMeshInstance(MeshInstance *mi); … … 81 78 void SetupCamera(); 82 79 void RandomViewPoint(); 80 81 void 82 RenderScene(); 83 83 84 void initializeGL(); 84 void 85 SetupProjection(const int w, const int h); 86 87 88 89 float 90 GetPixelError(); 91 92 void InitGL(); 93 94 virtual int GetWidth() const = 0; 95 virtual int GetHeight() const = 0; 96 }; 97 98 99 class GlRendererBuffer : public QGLPixelBuffer, public GlRenderer 100 { 101 102 public: 103 int mPvsStatFrames; 104 vector<float> mPvsErrorBuffer; 105 106 PvsRenderStatistics mPvsStat; 107 108 109 GlRendererBuffer(const int w, 110 const int h, 111 SceneGraph *sceneGraph, 112 ViewCellsManager *viewcells): 113 QGLPixelBuffer(QSize(w, h)), GlRenderer(sceneGraph, viewcells) { 114 115 mPvsStatFrames = 10000; 116 mPvsErrorBuffer.resize(mPvsStatFrames); 117 ClearErrorBuffer(); 118 119 makeCurrent(); 120 InitGL(); 121 122 } 123 124 void 125 EvalPvsStat(); 126 127 void 128 ClearErrorBuffer(); 129 130 131 132 virtual int GetWidth() const { return width(); } 133 virtual int GetHeight() const { return height(); } 134 135 }; 136 137 138 139 class GlRendererWidget : public QGLWidget, public GlRenderer 140 { 141 Q_OBJECT 142 public: 143 144 GlRendererWidget(SceneGraph *sceneGraph, 145 ViewCellsManager *viewcells, 146 QWidget * parent = 0, const QGLWidget * shareWidget = 0, Qt::WFlags f = 0 147 ): 148 GlRenderer(sceneGraph, viewcells), QGLWidget(parent, shareWidget, f) 149 {} 150 151 Vector3 mousePoint; 152 153 void initializeGL() { 154 InitGL(); 155 } 85 156 void resizeGL(int w, int h); 86 157 void paintGL(); 87 158 void timerEvent(QTimerEvent *) { 88 if (mRender)89 159 update(); 90 160 } … … 94 164 void mouseMoveEvent(QMouseEvent *); 95 165 96 void97 ClearErrorBuffer();166 float 167 RenderErrors(); 98 168 99 void 100 RenderScene(); 101 102 void 103 SetupProjection(const int w, const int h); 104 105 public slots: 106 void 107 EvalPvsStat(); 108 109 float Render(); 110 111 float 112 GetPixelError(); 113 169 virtual int GetWidth() const { return width(); } 170 virtual int GetHeight() const { return height(); } 114 171 115 172 }; 116 173 117 174 118 extern GlRenderer *renderer;175 extern GlRendererWidget *rendererWidget; 119 176 120 177 #endif -
trunk/VUT/GtpVisibilityPreprocessor/src/Makefile
r494 r496 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (2.00a) (Qt 4.1.0) on: út 3. I 23:44:1820063 # Generated by qmake (2.00a) (Qt 4.1.0) on: st 4. I 15:01:55 2006 4 4 # Project: preprocessor.pro 5 5 # Template: app … … 63 63 $(MAKE) -f $(MAKEFILE).Debug uninstall 64 64 65 Makefile: preprocessor.pro C:/Qt/4.1.0/mkspecs/win32-msvc.net\qmake.conf C:/Qt/4.1.0/mkspecs/qconfig.pri \66 C:\Qt\4.1.0\mkspecs\features\qt_config.prf \67 C:\Qt\4.1.0\mkspecs\features\exclusive_builds.prf \68 C:\Qt\4.1.0\mkspecs\features\default_pre.prf \69 C:\Qt\4.1.0\mkspecs\features\win32\default_pre.prf \70 C:\Qt\4.1.0\mkspecs\features\release.prf \71 C:\Qt\4.1.0\mkspecs\features\debug_and_release.prf \72 C:\Qt\4.1.0\mkspecs\features\default_post.prf \73 C:\Qt\4.1.0\mkspecs\features\qt.prf \74 C:\Qt\4.1.0\mkspecs\features\win32\opengl.prf \75 C:\Qt\4.1.0\mkspecs\features\moc.prf \76 C:\Qt\4.1.0\mkspecs\features\win32\thread.prf \77 C:\Qt\4.1.0\mkspecs\features\warn_off.prf \78 C:\Qt\4.1.0\mkspecs\features\win32\console.prf \79 C:\Qt\4.1.0\mkspecs\features\win32\rtti.prf \80 C:\Qt\4.1.0\mkspecs\features\win32\exceptions.prf \81 C:\Qt\4.1.0\mkspecs\features\win32\stl.prf \82 C:\Qt\4.1.0\mkspecs\features\shared.prf \83 C:\Qt\4.1.0\mkspecs\features\resources.prf \84 C:\Qt\4.1.0\mkspecs\features\uic.prf65 Makefile: preprocessor.pro D:/Qt/4.1.0/mkspecs/win32-msvc.net\qmake.conf D:/Qt/4.1.0/mkspecs/qconfig.pri \ 66 D:\Qt\4.1.0\mkspecs\features\qt_config.prf \ 67 D:\Qt\4.1.0\mkspecs\features\exclusive_builds.prf \ 68 D:\Qt\4.1.0\mkspecs\features\default_pre.prf \ 69 D:\Qt\4.1.0\mkspecs\features\win32\default_pre.prf \ 70 D:\Qt\4.1.0\mkspecs\features\release.prf \ 71 D:\Qt\4.1.0\mkspecs\features\debug_and_release.prf \ 72 D:\Qt\4.1.0\mkspecs\features\default_post.prf \ 73 D:\Qt\4.1.0\mkspecs\features\qt.prf \ 74 D:\Qt\4.1.0\mkspecs\features\win32\opengl.prf \ 75 D:\Qt\4.1.0\mkspecs\features\moc.prf \ 76 D:\Qt\4.1.0\mkspecs\features\win32\thread.prf \ 77 D:\Qt\4.1.0\mkspecs\features\warn_off.prf \ 78 D:\Qt\4.1.0\mkspecs\features\win32\console.prf \ 79 D:\Qt\4.1.0\mkspecs\features\win32\rtti.prf \ 80 D:\Qt\4.1.0\mkspecs\features\win32\exceptions.prf \ 81 D:\Qt\4.1.0\mkspecs\features\win32\stl.prf \ 82 D:\Qt\4.1.0\mkspecs\features\shared.prf \ 83 D:\Qt\4.1.0\mkspecs\features\resources.prf \ 84 D:\Qt\4.1.0\mkspecs\features\uic.prf 85 85 $(QMAKE) -win32 -o Makefile preprocessor.pro 86 C:/Qt/4.1.0/mkspecs/qconfig.pri:87 C:\Qt\4.1.0\mkspecs\features\qt_config.prf:88 C:\Qt\4.1.0\mkspecs\features\exclusive_builds.prf:89 C:\Qt\4.1.0\mkspecs\features\default_pre.prf:90 C:\Qt\4.1.0\mkspecs\features\win32\default_pre.prf:91 C:\Qt\4.1.0\mkspecs\features\release.prf:92 C:\Qt\4.1.0\mkspecs\features\debug_and_release.prf:93 C:\Qt\4.1.0\mkspecs\features\default_post.prf:94 C:\Qt\4.1.0\mkspecs\features\qt.prf:95 C:\Qt\4.1.0\mkspecs\features\win32\opengl.prf:96 C:\Qt\4.1.0\mkspecs\features\moc.prf:97 C:\Qt\4.1.0\mkspecs\features\win32\thread.prf:98 C:\Qt\4.1.0\mkspecs\features\warn_off.prf:99 C:\Qt\4.1.0\mkspecs\features\win32\console.prf:100 C:\Qt\4.1.0\mkspecs\features\win32\rtti.prf:101 C:\Qt\4.1.0\mkspecs\features\win32\exceptions.prf:102 C:\Qt\4.1.0\mkspecs\features\win32\stl.prf:103 C:\Qt\4.1.0\mkspecs\features\shared.prf:104 C:\Qt\4.1.0\mkspecs\features\resources.prf:105 C:\Qt\4.1.0\mkspecs\features\uic.prf:86 D:/Qt/4.1.0/mkspecs/qconfig.pri: 87 D:\Qt\4.1.0\mkspecs\features\qt_config.prf: 88 D:\Qt\4.1.0\mkspecs\features\exclusive_builds.prf: 89 D:\Qt\4.1.0\mkspecs\features\default_pre.prf: 90 D:\Qt\4.1.0\mkspecs\features\win32\default_pre.prf: 91 D:\Qt\4.1.0\mkspecs\features\release.prf: 92 D:\Qt\4.1.0\mkspecs\features\debug_and_release.prf: 93 D:\Qt\4.1.0\mkspecs\features\default_post.prf: 94 D:\Qt\4.1.0\mkspecs\features\qt.prf: 95 D:\Qt\4.1.0\mkspecs\features\win32\opengl.prf: 96 D:\Qt\4.1.0\mkspecs\features\moc.prf: 97 D:\Qt\4.1.0\mkspecs\features\win32\thread.prf: 98 D:\Qt\4.1.0\mkspecs\features\warn_off.prf: 99 D:\Qt\4.1.0\mkspecs\features\win32\console.prf: 100 D:\Qt\4.1.0\mkspecs\features\win32\rtti.prf: 101 D:\Qt\4.1.0\mkspecs\features\win32\exceptions.prf: 102 D:\Qt\4.1.0\mkspecs\features\win32\stl.prf: 103 D:\Qt\4.1.0\mkspecs\features\shared.prf: 104 D:\Qt\4.1.0\mkspecs\features\resources.prf: 105 D:\Qt\4.1.0\mkspecs\features\uic.prf: 106 106 qmake: qmake_all FORCE 107 107 @$(QMAKE) -win32 -o Makefile preprocessor.pro -
trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp
r492 r496 11 11 #include "VspKdTree.h" 12 12 #include "RenderSimulator.h" 13 #include "GlRenderer.h" 13 14 14 15 Preprocessor *preprocessor; … … 22 23 { 23 24 environment->GetBoolValue("Preprocessor.useGlRenderer", mUseGlRenderer); 25 // renderer will be constructed when the scene graph and viewcell manager will be known 26 renderer = NULL; 27 24 28 } 25 29 … … 27 31 Preprocessor::~Preprocessor() 28 32 { 29 30 31 32 33 33 DEL_PTR(mViewCellsManager); 34 DEL_PTR(mBspTree); 35 DEL_PTR(mKdTree); 36 DEL_PTR(mVspKdTree); 37 DEL_PTR(mVspBspTree); 34 38 } 35 39 … … 256 260 } 257 261 262 263 if (mUseGlRenderer) 264 renderer = new GlRendererBuffer(1024, 768, mSceneGraph, mViewCellsManager); 265 258 266 return true; 259 267 } -
trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.h
r492 r496 20 20 struct VssRayContainer; 21 21 22 class GlRendererBuffer; 22 23 23 24 /** Namespace for the external visibility preprocessor … … 136 137 RenderSimulator *mRenderSimulator; 137 138 139 GlRendererBuffer *renderer; 140 138 141 signals: 139 142 void EvalPvsStat(); -
trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp
r492 r496 449 449 // compute rendering error 450 450 if (renderer) { 451 emit EvalPvsStat(); 452 QMutex mutex; 453 mutex.lock(); 454 renderer->mRenderingFinished.wait(&mutex); 455 mutex.unlock(); 451 // emit EvalPvsStat(); 452 // QMutex mutex; 453 // mutex.lock(); 454 // renderer->mRenderingFinished.wait(&mutex); 455 // mutex.unlock(); 456 renderer->EvalPvsStat(); 456 457 mStats << 457 458 "#AvgPvsRenderError\n" <<renderer->mPvsStat.GetAvgError()<<endl<< … … 465 466 { 466 467 467 connect(this, SIGNAL(EvalPvsStat()), renderer, SLOT(EvalPvsStat()) );468 // connect(this, SIGNAL(EvalPvsStat()), renderer, SLOT(EvalPvsStat()) ); 468 469 469 470 cout<<"Rss Preprocessor started\n"<<flush; -
trunk/VUT/GtpVisibilityPreprocessor/src/default.env
r492 r496 162 162 #type kdTree 163 163 #type vspKdTree 164 #type bspTree165 type vspBspTree164 type bspTree 165 # type vspBspTree 166 166 167 167 #type sceneDependent -
trunk/VUT/GtpVisibilityPreprocessor/src/main.cpp
r494 r496 55 55 exit(1); 56 56 } 57 58 QApplication *app = NULL; 59 60 if (p->mUseGlRenderer) { 61 // create a qt application first (must be created before any opengl widget... 62 app = new QApplication(argc, argv); 63 64 if (!QGLFormat::hasOpenGL() || !QGLPixelBuffer::hasOpenGLPbuffers()) { 65 QMessageBox::information(0, "OpenGL pbuffers", 66 "This system does not support OpenGL/pbuffers.", 67 QMessageBox::Ok); 68 return -1; 69 } 70 } 57 71 58 72 preprocessor = p; … … 79 93 80 94 if (p->mUseGlRenderer) { 81 QApplication a(argc, argv);82 95 83 if (!QGLFormat::hasOpenGL() || !QGLPixelBuffer::hasOpenGLPbuffers()) { 84 QMessageBox::information(0, "OpenGL pbuffers", 85 "This system does not support OpenGL/pbuffers.", 86 QMessageBox::Ok); 87 return -1; 88 } 89 90 renderer = new GlRenderer(p->mSceneGraph, p->mViewCellsManager); 96 rendererWidget = new GlRendererWidget(p->mSceneGraph, p->mViewCellsManager); 91 97 // renderer->resize(640, 480); 92 renderer->resize(1024, 768); 93 renderer->show(); 94 95 98 rendererWidget->resize(640, 480); 99 rendererWidget->show(); 100 96 101 pt->start(QThread::LowPriority); 97 102 98 return a.exec();99 103 } else { 100 104 // just call the mail method -> will be executed in the main thread … … 105 109 // DEL_PTR(p); 106 110 // DEL_PTR(environment); 111 if (app) 112 return app->exec(); 107 113 108 114 return 0;
Note: See TracChangeset
for help on using the changeset viewer.