Ignore:
Timestamp:
05/14/08 19:06:06 (16 years ago)
Author:
mattausch
Message:
 
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  
    7070 
    7171 
    72 void QtGlRendererBuffer::MakeCurrent() 
     72void QtGlRendererBuffer::MakeLive() 
    7373{ 
    7474        QGLPixelBuffer::makeCurrent(); 
     
    7777 
    7878 
    79 void QtGlRendererBuffer::DoneCurrent() 
     79void QtGlRendererBuffer::DoneLive() 
    8080{ 
    8181        QGLPixelBuffer::doneCurrent(); 
     
    9292                                                 QGL::DepthBuffer |  
    9393                                                 QGL::DoubleBuffer | 
    94                                                  QGL::Rgba 
    95                                                  )), 
     94                                                 QGL::Rgba) 
     95                                                 ), 
    9696GlRendererBuffer(sceneGraph, viewcells, tree) 
    9797{ 
     
    9999        //mUseVbos = false; 
    100100         
    101         MakeCurrent(); 
     101        MakeLive(); 
    102102        glViewport(0, 0, w, h); 
    103103    glMatrixMode(GL_PROJECTION); 
     
    109109 
    110110        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(); 
    112117} 
    113118 
     
    133138float QtGlRendererBuffer::GetPixelError(int &pvsSize) 
    134139{ 
    135         MakeCurrent(); 
     140        MakeLive(); 
    136141 
    137142        if (0) 
     
    141146                cout << "rgba: " << format().rgba() << endl; 
    142147                cout << "double: " << format().doubleBuffer() << endl; 
     148                cout << "depth: " << format().depth() << endl; 
     149                cout << "gl:" << format().hasOpenGL() << endl; 
     150                cout << "dir:" << format().directRendering() << endl; 
    143151        } 
    144152 
     
    249257        pixelCount = query->GetQueryResult(); 
    250258 
    251         pErrorPixels = ((float)pixelCount) / (GetWidth() * GetHeight()); 
    252  
     259        pErrorPixels = (float)pixelCount / (GetWidth() * GetHeight()); 
     260 
     261        // some error happened 
    253262        if (pixelCount > 0)  
    254263        { 
     
    265274 
    266275                        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); 
    268278                        QImage im = toImage(); 
    269279                        string str = mSnapPrefix + filename; 
     
    306316        glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    307317 
    308         DoneCurrent(); 
     318        DoneLive(); 
    309319 
    310320        return pErrorPixels; 
     
    23992409        // bind the dynamic texture to the pbuffer - this is a no-op under X11 
    24002410        mRenderBuffer->bindToDynamicTexture(dynamicTexture); 
    2401         makeCurrent(); 
     2411        //makeCurrent(); 
    24022412} 
    24032413 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h

    r2671 r2677  
    6161        ~QtGlRendererBuffer() {} 
    6262 
    63         virtual void MakeCurrent(); 
    64         virtual void DoneCurrent(); 
     63        virtual void MakeLive(); 
     64        virtual void DoneLive(); 
    6565 
    6666        virtual int GetWidth() const { return width(); } 
     
    7575        int ComputePvs(ObjectContainer &objects, ObjectContainer &pvs) const; 
    7676 
     77        unsigned int mydynamicTexture; 
    7778 
    7879public: 
     
    311312 
    312313public slots: 
    313 void UpdateDynamicObjects(); 
     314         
     315        void UpdateDynamicObjects(); 
    314316        void UpdateAllPvs(); 
    315317        void ComputeVisibility(); 
     
    516518                        mShowDistribution ^= 1; 
    517519 
    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;  
    519525        } 
    520526 
Note: See TracChangeset for help on using the changeset viewer.