~ubuntu-branches/debian/sid/openscenegraph/sid

« back to all changes in this revision

Viewing changes to OpenSceneGraph/src/osgPlugins/cfg/ReaderWriterCFG.cpp

  • Committer: Package Import Robot
  • Author(s): Manuel A. Fernandez Montecelo, Alberto Luaces, Manuel A. Fernandez Montecelo
  • Date: 2013-07-30 13:07:57 UTC
  • mfrom: (1.4.3)
  • Revision ID: package-import@ubuntu.com-20130730130757-b3weq3502sennb16
Tags: 3.2.0~rc1-1
[Alberto Luaces]
* New upstream release.
* Updated standards version (3.9.4).
* Updated SVN URL.
* Removed the static version of the libraries since they impose a huge
  load on the build servers, add additional complexity on the build
  scripts, and make a great impact on the size of the packages, given
  the very small cases where they are useful.
* Acknowledge NMU.

[ Manuel A. Fernandez Montecelo ]
* Switch to @debian.org address

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*-c++-*- OpenSceneGraph - Copyright (C) 2007 Cedric Pinson
2
2
 *
3
 
 * This application is open source and may be redistributed and/or modified   
 
3
 * This application is open source and may be redistributed and/or modified
4
4
 * freely and without restriction, both in commercial and non commercial
5
5
 * applications, as long as this copyright notice is maintained.
6
 
 * 
 
6
 *
7
7
 * This application is distributed in the hope that it will be useful,
8
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
38
38
static osg::GraphicsContext::Traits* buildTrait(RenderSurface& rs)
39
39
{
40
40
    VisualChooser& vc = *rs.getVisualChooser();
41
 
    
 
41
 
42
42
    osg::GraphicsContext::Traits* traits = new osg::GraphicsContext::Traits;
43
 
    
44
 
    for (std::vector<VisualChooser::VisualAttribute>::iterator it = vc._visual_attributes.begin(); 
45
 
        it != vc._visual_attributes.end(); 
 
43
 
 
44
    for (std::vector<VisualChooser::VisualAttribute>::iterator it = vc._visual_attributes.begin();
 
45
        it != vc._visual_attributes.end();
46
46
        it++)
47
47
    {
48
48
        switch(it->_attribute)
51
51
            case(VisualChooser::BufferSize):       break; // no present mapping
52
52
            case(VisualChooser::Level):            traits->level = it->_parameter; break;
53
53
            case(VisualChooser::RGBA):             break; // automatically set in osgViewer
54
 
            case(VisualChooser::DoubleBuffer):     traits->doubleBuffer = true; break; 
 
54
            case(VisualChooser::DoubleBuffer):     traits->doubleBuffer = true; break;
55
55
            case(VisualChooser::Stereo):           traits->quadBufferStereo = true; break;
56
56
            case(VisualChooser::AuxBuffers):       break; // no present mapping
57
57
            case(VisualChooser::RedSize):          traits->red = it->_parameter; break;
65
65
            case(VisualChooser::AccumBlueSize):    break; // no present mapping
66
66
            case(VisualChooser::AccumAlphaSize):   break; // no present mapping
67
67
            case(VisualChooser::Samples):          traits->samples = it->_parameter; break;
68
 
            case(VisualChooser::SampleBuffers):    traits->sampleBuffers = it->_parameter; break;
 
68
            case(VisualChooser::SampleBuffers):    traits->sampleBuffers = 1; break;
69
69
        }
70
70
    }
71
71
 
72
 
    OSG_INFO<<"Set up Traits ( rs.getScreenNum() = "<<rs.getScreenNum()<<" )"<<std::endl;
73
 
 
74
 
    
 
72
    OSG_INFO<<"ReaderWriterCFG buildTrait traits->depth="<<traits->depth<<std::endl;
 
73
    OSG_INFO<<"ReaderWriterCFG buildTrait traits->samples="<<traits->samples<<std::endl;
 
74
    OSG_INFO<<"ReaderWriterCFG buildTrait traits->sampleBuffers="<<traits->sampleBuffers<<std::endl;
 
75
 
 
76
 
75
77
    traits->hostName = rs.getHostName();
76
78
    traits->displayNum = rs.getDisplayNum();
77
79
    traits->screenNum = rs.getScreenNum();
118
120
        {
119
121
            osg::GraphicsContext::Traits* newtraits = buildTrait(*rs);
120
122
 
121
 
#if 0            
 
123
#if 0
122
124
            osg::GraphicsContext::ScreenIdentifier si;
123
125
            si.readDISPLAY();
124
126
 
125
127
            if (si.displayNum>=0) newtraits->displayNum = si.displayNum;
126
128
            if (si.screenNum>=0) newtraits->screenNum = si.screenNum;
127
129
#endif
128
 
    
 
130
 
129
131
            gc = osg::GraphicsContext::createGraphicsContext(newtraits);
130
 
            
 
132
 
131
133
            surfaces[rs] = gc.get();
132
134
            traits = gc.valid() ? gc->getTraits() : 0;
133
135
        }
175
177
            OSG_INFO<<"  GraphicsWindow has not been created successfully."<<std::endl;
176
178
            return 0;
177
179
        }
178
 
        
 
180
 
179
181
    }
180
182
 
181
183
    // std::cout << "done" << std::endl;
185
187
//
186
188
// OSG interface to read/write from/to a file.
187
189
//
188
 
class ReaderWriterProducerCFG : public osgDB::ReaderWriter 
 
190
class ReaderWriterProducerCFG : public osgDB::ReaderWriter
189
191
{
190
192
public:
191
193