~ubuntu-branches/ubuntu/lucid/meshlab/lucid

« back to all changes in this revision

Viewing changes to meshlab/src/fgt/render_rfx/render_rfx.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Teemu Ikonen
  • Date: 2009-10-08 16:40:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091008164041-0c2ealqv8b8uc20c
Tags: 1.2.2-1
* New upstream version
* Do not build filter_isoparametrization because liblevmar dependency
  is not (yet) in Debian
* Fix compilation with gcc-4.4, thanks to Jonathan Liu for the patch
  (closes: #539544)
* rules: Add compiler variables to the qmake call (for testing with new
  GCC versions)
* io_3ds.pro: Make LIBS and INCLUDEPATH point to Debian version of lib3ds
* io_epoch.pro: Make LIBS point to Debian version of libbz2
* control:
  - Move Homepage URL to the source package section
  - Update to standards-version 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
        foreach (QString fileName, shadersDir.entryList(QDir::Files)) {
89
89
                if (fileName.endsWith(".rfx")) {
90
90
                        RfxParser theParser(shadersDir.absoluteFilePath(fileName));
91
 
                        if (theParser.Parse()) {
 
91
                        if (theParser.isValidDoc()) {
92
92
                                QAction *action = new QAction(fileName, this);
93
93
                                action->setCheckable(false);
94
94
                                actionList.append(action);
120
120
                                        }                       
121
121
                        }
122
122
 
123
 
        theParser.Parse();
 
123
        theParser.Parse(md);
124
124
        activeShader = theParser.GetShader();
125
125
        assert(activeShader);
126
126
 
129
129
                delete dialog;
130
130
        }
131
131
 
 
132
        //verifies if there's some special attributes in the shader.
 
133
        if(!activeShader->checkSpecialAttributeDataMask(&md))
 
134
                return;
 
135
        
 
136
 
132
137
        parent->makeCurrent();
133
138
        GLenum err = glewInit();
134
139
        if (GLEW_OK == err) {
153
158
        assert(activeShader);
154
159
        rm.textureMode = vcg::GLW::TMPerWedge;
155
160
        
 
161
        
156
162
        for(shaderPass=0;shaderPass<totPass;shaderPass++)
157
163
        {
158
164
                activeShader->Start(shaderPass);
159
 
                glGetError();
160
 
                foreach(MeshModel * mp, md.meshList)
 
165
                        glGetError();
 
166
                        foreach(MeshModel * mp, md.meshList)
161
167
                        {
162
 
                                if(mp->visible) mp->Render(rm.drawMode,rm.colorMode,rm.textureMode);
 
168
                                
 
169
                                if(mp->visible && activeShader->GetPass(shaderPass)->hasSpecialAttribute()){
 
170
                                        GLuint *program = activeShader->GetPass(shaderPass)->getProgram();
 
171
                                                                
 
172
                                        Draw(&md, program, activeShader->GetPass(shaderPass)->AttributesList());
 
173
                                
 
174
 
 
175
                                }
 
176
                                else{
 
177
                                        if(mp->visible) 
 
178
                                                mp->Render(rm.drawMode,rm.colorMode,rm.textureMode);
 
179
                                }
 
180
                                
163
181
                        }
164
182
        }
165
183
        glUseProgramObjectARB(0);