root/OpenSceneGraph/trunk/src/osg/DisplaySettings.cpp @ 10601

Revision 10601, 19.1 kB (checked in by robert, 5 years ago)

Introduced new GLBufferObject pool for managing the memory footprint taken up by VertexBufferObejct?, ElementBufferObject? and PixelBufferObject?.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
RevLine 
[5328]1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
[1529]2 *
3 * This library is open source and may be redistributed and/or modified under 
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
[235]13#include <osg/DisplaySettings>
[1612]14#include <osg/ArgumentParser>
[1610]15#include <osg/ApplicationUsage>
[10415]16#include <osg/Math>
[5358]17#include <osg/Notify>
[1463]18#include <osg/ref_ptr>
[235]19
20#include <algorithm>
[7640]21#include <string.h>
[235]22
23using namespace osg;
[416]24using namespace std;
25
[434]26DisplaySettings* DisplaySettings::instance()
27{
[1463]28    static ref_ptr<DisplaySettings> s_displaySettings = new DisplaySettings;
[434]29    return s_displaySettings.get();
30}
31
[7256]32DisplaySettings::DisplaySettings(const DisplaySettings& vs):Referenced(true)
[235]33{
[2948]34    setDisplaySettings(vs);
[235]35}
36
37DisplaySettings::~DisplaySettings()
38{
39}
40
[434]41 
42 DisplaySettings& DisplaySettings::operator = (const DisplaySettings& vs)
[235]43{
44    if (this==&vs) return *this;
[2948]45    setDisplaySettings(vs);
[235]46    return *this;
47}
48
[2948]49void DisplaySettings::setDisplaySettings(const DisplaySettings& vs)
[235]50{
[2336]51    _displayType = vs._displayType;
[4171]52    _stereo = vs._stereo;
[235]53    _stereoMode = vs._stereoMode;
[1110]54    _eyeSeparation = vs._eyeSeparation;
[2413]55    _screenWidth = vs._screenWidth;
56    _screenHeight = vs._screenHeight;
[235]57    _screenDistance = vs._screenDistance;
58
[558]59    _splitStereoHorizontalEyeMapping = vs._splitStereoHorizontalEyeMapping;
[1110]60    _splitStereoHorizontalSeparation = vs._splitStereoHorizontalSeparation;
[558]61
62    _splitStereoVerticalEyeMapping = vs._splitStereoVerticalEyeMapping;
[1110]63    _splitStereoVerticalSeparation = vs._splitStereoVerticalSeparation;
[1979]64   
65    _splitStereoAutoAdjustAspectRatio = vs._splitStereoAutoAdjustAspectRatio;
[558]66
[235]67    _doubleBuffer = vs._doubleBuffer;
68    _RGB = vs._RGB;
69    _depthBuffer = vs._depthBuffer;
70    _minimumNumberAlphaBits = vs._minimumNumberAlphaBits;
71    _minimumNumberStencilBits = vs._minimumNumberStencilBits;
[434]72
73    _maxNumOfGraphicsContexts = vs._maxNumOfGraphicsContexts;
[5043]74    _numMultiSamples = vs._numMultiSamples;
[7215]75   
76    _compileContextsHint = vs._compileContextsHint;
[7274]77    _serializeDrawDispatch = vs._serializeDrawDispatch;
[9055]78   
79    _numDatabaseThreadsHint = vs._numDatabaseThreadsHint;
80    _numHttpDatabaseThreadsHint = vs._numHttpDatabaseThreadsHint;
[9191]81   
82    _application = vs._application;
[10588]83
84    _maxTexturePoolSize = vs._maxTexturePoolSize;
[10601]85    _maxBufferObjectPoolSize = vs._maxBufferObjectPoolSize;
[235]86}
87
88void DisplaySettings::merge(const DisplaySettings& vs)
89{
90    if (_stereo       || vs._stereo)        _stereo = true;
91   
92    // need to think what to do about merging the stereo mode.
93   
94    if (_doubleBuffer || vs._doubleBuffer)  _doubleBuffer = true;
95    if (_RGB          || vs._RGB)           _RGB = true;
96    if (_depthBuffer  || vs._depthBuffer)   _depthBuffer = true;
97   
98    if (vs._minimumNumberAlphaBits>_minimumNumberAlphaBits) _minimumNumberAlphaBits = vs._minimumNumberAlphaBits;
99    if (vs._minimumNumberStencilBits>_minimumNumberStencilBits) _minimumNumberStencilBits = vs._minimumNumberStencilBits;
[5043]100    if (vs._numMultiSamples>_numMultiSamples) _numMultiSamples = vs._numMultiSamples;
[7215]101
102    if (vs._compileContextsHint) _compileContextsHint = vs._compileContextsHint;
[7274]103    if (vs._serializeDrawDispatch) _serializeDrawDispatch = vs._serializeDrawDispatch;
[9055]104
105    if (vs._numDatabaseThreadsHint>_numDatabaseThreadsHint) _numDatabaseThreadsHint = vs._numDatabaseThreadsHint;
106    if (vs._numHttpDatabaseThreadsHint>_numHttpDatabaseThreadsHint) _numHttpDatabaseThreadsHint = vs._numHttpDatabaseThreadsHint;
[9191]107
108    if (_application.empty()) _application = vs._application;
[10588]109
110    if (vs._maxTexturePoolSize>_maxTexturePoolSize) _maxTexturePoolSize = vs._maxTexturePoolSize;
[10601]111    if (vs._maxBufferObjectPoolSize>_maxBufferObjectPoolSize) _maxBufferObjectPoolSize = vs._maxBufferObjectPoolSize;
[235]112}
113
114void DisplaySettings::setDefaults()
115{
[2336]116    _displayType = MONITOR;
117
[235]118    _stereo = false;
119    _stereoMode = ANAGLYPHIC;
[1110]120    _eyeSeparation = 0.05f;
[2413]121    _screenWidth = 0.325f;
122    _screenHeight = 0.26f;
[235]123    _screenDistance = 0.5f;
124
[558]125    _splitStereoHorizontalEyeMapping = LEFT_EYE_LEFT_VIEWPORT;
[1977]126    _splitStereoHorizontalSeparation = 0;
[558]127
128    _splitStereoVerticalEyeMapping = LEFT_EYE_TOP_VIEWPORT;
[1977]129    _splitStereoVerticalSeparation = 0;
[558]130
[1979]131    _splitStereoAutoAdjustAspectRatio = true;
132
[235]133    _doubleBuffer = true;
134    _RGB = true;
135    _depthBuffer = true;
136    _minimumNumberAlphaBits = 0;
137    _minimumNumberStencilBits = 0;
[4665]138    _minimumNumberAccumRedBits = 0;
139    _minimumNumberAccumGreenBits = 0;
140    _minimumNumberAccumBlueBits = 0;
141    _minimumNumberAccumAlphaBits = 0;
[434]142   
[5358]143    _maxNumOfGraphicsContexts = 32;
[5043]144    _numMultiSamples = 0;
145
146    #ifdef __sgi
147    // switch on anti-aliasing by default, just in case we have an Onyx :-)
148    _numMultiSamples = 4;
149    #endif
[7215]150   
151    _compileContextsHint = false;
[7274]152    _serializeDrawDispatch = true;
[9055]153
154    _numDatabaseThreadsHint = 2;
155    _numHttpDatabaseThreadsHint = 1;
[10588]156
157    _maxTexturePoolSize = 0;
[10601]158    _maxBufferObjectPoolSize = 0;
[235]159}
160
[5358]161void DisplaySettings::setMaxNumberOfGraphicsContexts(unsigned int num)
162{
163    _maxNumOfGraphicsContexts = num;
164}
165
166unsigned int DisplaySettings::getMaxNumberOfGraphicsContexts() const
167{
168    // osg::notify(osg::NOTICE)<<"getMaxNumberOfGraphicsContexts()="<<_maxNumOfGraphicsContexts<<std::endl;
169    return _maxNumOfGraphicsContexts;
170}
171
[4665]172void DisplaySettings::setMinimumNumAccumBits(unsigned int red, unsigned int green, unsigned int blue, unsigned int alpha)
173{
174    _minimumNumberAccumRedBits = red;
175    _minimumNumberAccumGreenBits = green;
176    _minimumNumberAccumBlueBits = blue;
177    _minimumNumberAccumAlphaBits = alpha;
178}
179
[2336]180static ApplicationUsageProxy DisplaySetting_e0(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_DISPLAY_TYPE <type>","MONITOR | POWERWALL | REALITY_CENTER | HEAD_MOUNTED_DISPLAY");
[4613]181static ApplicationUsageProxy DisplaySetting_e1(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_STEREO_MODE <mode>","QUAD_BUFFER | ANAGLYPHIC | HORIZONTAL_SPLIT | VERTICAL_SPLIT | LEFT_EYE | RIGHT_EYE | VERTICAL_INTERLACE | HORIZONTAL_INTERLACE");
[2336]182static ApplicationUsageProxy DisplaySetting_e2(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_STEREO <mode>","OFF | ON");
183static ApplicationUsageProxy DisplaySetting_e3(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_EYE_SEPARATION <float>","physical distance between eyes");
184static ApplicationUsageProxy DisplaySetting_e4(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SCREEN_DISTANCE <float>","physical distance between eyes and screen");
185static ApplicationUsageProxy DisplaySetting_e5(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SCREEN_HEIGHT <float>","physical screen height");
[3714]186static ApplicationUsageProxy DisplaySetting_e6(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SCREEN_WIDTH <float>","physical screen width");
187static ApplicationUsageProxy DisplaySetting_e7(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SPLIT_STEREO_HORIZONTAL_EYE_MAPPING <mode>","LEFT_EYE_LEFT_VIEWPORT | LEFT_EYE_RIGHT_VIEWPORT");
188static ApplicationUsageProxy DisplaySetting_e8(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SPLIT_STEREO_HORIZONTAL_SEPARATION <float>","number of pixels between viewports");
189static ApplicationUsageProxy DisplaySetting_e9(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SPLIT_STEREO_VERTICAL_EYE_MAPPING <mode>","LEFT_EYE_TOP_VIEWPORT | LEFT_EYE_BOTTOM_VIEWPORT");
190static ApplicationUsageProxy DisplaySetting_e10(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SPLIT_STEREO_AUTO_ADJUST_ASPECT_RATIO <mode>","OFF | ON  Default to ON to compenstate for the compression of the aspect ratio when viewing in split screen stereo.  Note, if you are setting fovx and fovy explicityly OFF should be used.");
191static ApplicationUsageProxy DisplaySetting_e11(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SPLIT_STEREO_VERTICAL_SEPARATION <float>","number of pixels between viewports");
192static ApplicationUsageProxy DisplaySetting_e12(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MAX_NUMBER_OF_GRAPHICS_CONTEXTS <int>","maximum number of graphics contexts to be used with applications.");
[9807]193static ApplicationUsageProxy DisplaySetting_e13(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_COMPILE_CONTEXTS <mode>","OFF | ON Enable/disable the use a backgrouind compile contexts and threads.");
[7274]194static ApplicationUsageProxy DisplaySetting_e14(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SERIALIZE_DRAW_DISPATCH <mode>","OFF | ON Enable/disable the use a muetx to serialize the draw dispatch when there are multiple graphics threads.");
[9055]195static ApplicationUsageProxy DisplaySetting_e15(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_NUM_DATABASE_THREADS <int>","Set the hint for the total number of threads to set up in the DatabasePager.");
196static ApplicationUsageProxy DisplaySetting_e16(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_NUM_HTTP_DATABASE_THREADS <int>","Set the hint for the total number of threads dedicated to http requests to set up in the DatabasePager.");
[9973]197static ApplicationUsageProxy DisplaySetting_e17(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MULTI_SAMPLES <int>","Set the hint for the number of samples to use when multi-sampling.");
[10588]198static ApplicationUsageProxy DisplaySetting_e18(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_TEXTURE_POOL_SIZE <int>","Set the hint size of texture pool to manage.");
[10601]199static ApplicationUsageProxy DisplaySetting_e19(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_BUFFER_OBJECT_POOL_SIZE <int>","Set the hint size of vertex buffer object pool to manage.");
[10588]200static ApplicationUsageProxy DisplaySetting_e20(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_FBO_POOL_SIZE <int>","Set the hint size of frame buffer object pool to manage.");
[7274]201
[235]202void DisplaySettings::readEnvironmentalVariables()
203{
[4310]204    const char* ptr = 0;
[2336]205   
206    if ((ptr = getenv("OSG_DISPLAY_TYPE")) != 0)
207    {
208        if (strcmp(ptr,"MONITOR")==0)
209        {
210            _displayType = MONITOR;
211        }
212        else
213        if (strcmp(ptr,"POWERWALL")==0)
214        {
215            _displayType = POWERWALL;
216        }
217        else
218        if (strcmp(ptr,"REALITY_CENTER")==0)
219        {
220            _displayType = REALITY_CENTER;
221        }
222        else
223        if (strcmp(ptr,"HEAD_MOUNTED_DISPLAY")==0)
224        {
225            _displayType = HEAD_MOUNTED_DISPLAY;
226        }
227    }
228   
[339]229    if( (ptr = getenv("OSG_STEREO_MODE")) != 0)
[235]230    {
231        if (strcmp(ptr,"QUAD_BUFFER")==0)
232        {
233            _stereoMode = QUAD_BUFFER;
234        }
[4613]235        else if (strcmp(ptr,"ANAGLYPHIC")==0)
[235]236        {
237            _stereoMode = ANAGLYPHIC;
238        }
[4613]239        else if (strcmp(ptr,"HORIZONTAL_SPLIT")==0)
[235]240        {
241            _stereoMode = HORIZONTAL_SPLIT;
242        }
[4613]243        else if (strcmp(ptr,"VERTICAL_SPLIT")==0)
[235]244        {
245            _stereoMode = VERTICAL_SPLIT;
246        }
[4613]247        else if (strcmp(ptr,"LEFT_EYE")==0)
[1307]248        {
249            _stereoMode = LEFT_EYE;
250        }
[4613]251        else if (strcmp(ptr,"RIGHT_EYE")==0)
[1307]252        {
253            _stereoMode = RIGHT_EYE;
254        }
[4613]255        else if (strcmp(ptr,"HORIZONTAL_INTERLACE")==0)
256        {
257            _stereoMode = HORIZONTAL_INTERLACE;
258        }
259        else if (strcmp(ptr,"VERTICAL_INTERLACE")==0)
260        {
261            _stereoMode = VERTICAL_INTERLACE;
262        }
[7277]263        else if (strcmp(ptr,"CHECKERBOARD")==0)
264        {
265            _stereoMode = CHECKERBOARD;
266        }
[235]267    }
268
[339]269    if( (ptr = getenv("OSG_STEREO")) != 0)
[235]270    {
271        if (strcmp(ptr,"OFF")==0)
272        {
273            _stereo = false;
274        }
275        else
276        if (strcmp(ptr,"ON")==0)
277        {
278            _stereo = true;
279        }
280    }
281
[1110]282    if( (ptr = getenv("OSG_EYE_SEPARATION")) != 0)
[235]283    {
[10415]284        _eyeSeparation = osg::asciiToFloat(ptr);
[235]285    }
286
[2413]287    if( (ptr = getenv("OSG_SCREEN_WIDTH")) != 0)
[235]288    {
[10415]289        _screenWidth = osg::asciiToFloat(ptr);
[235]290    }
291
[339]292    if( (ptr = getenv("OSG_SCREEN_HEIGHT")) != 0)
[235]293    {
[10415]294        _screenHeight = osg::asciiToFloat(ptr);
[235]295    }
[434]296
[2413]297    if( (ptr = getenv("OSG_SCREEN_DISTANCE")) != 0)
298    {
[10415]299        _screenDistance = osg::asciiToFloat(ptr);
[2413]300    }
301
[558]302    if( (ptr = getenv("OSG_SPLIT_STEREO_HORIZONTAL_EYE_MAPPING")) != 0)
303    {
304        if (strcmp(ptr,"LEFT_EYE_LEFT_VIEWPORT")==0)
305        {
306            _splitStereoHorizontalEyeMapping = LEFT_EYE_LEFT_VIEWPORT;
307        }
308        else
309        if (strcmp(ptr,"LEFT_EYE_RIGHT_VIEWPORT")==0)
310        {
311            _splitStereoHorizontalEyeMapping = LEFT_EYE_RIGHT_VIEWPORT;
312        }
313    }
314
[1110]315    if( (ptr = getenv("OSG_SPLIT_STEREO_HORIZONTAL_SEPARATION")) != 0)
[558]316    {
[1110]317        _splitStereoHorizontalSeparation = atoi(ptr);
[558]318    }
319
320
321    if( (ptr = getenv("OSG_SPLIT_STEREO_VERTICAL_EYE_MAPPING")) != 0)
322    {
323        if (strcmp(ptr,"LEFT_EYE_TOP_VIEWPORT")==0)
324        {
325            _splitStereoVerticalEyeMapping = LEFT_EYE_TOP_VIEWPORT;
326        }
327        else
328        if (strcmp(ptr,"LEFT_EYE_BOTTOM_VIEWPORT")==0)
329        {
330            _splitStereoVerticalEyeMapping = LEFT_EYE_BOTTOM_VIEWPORT;
331        }
332    }
[1979]333   
334    if( (ptr = getenv("OSG_SPLIT_STEREO_AUTO_ADJUST_ASPECT_RATIO")) != 0)
335    {
336        if (strcmp(ptr,"OFF")==0)
337        {
[2428]338            _splitStereoAutoAdjustAspectRatio = false;
[1979]339        }
340        else
341        if (strcmp(ptr,"ON")==0)
342        {
[2428]343            _splitStereoAutoAdjustAspectRatio = true;
[1979]344        }
345    }
[558]346
[1110]347    if( (ptr = getenv("OSG_SPLIT_STEREO_VERTICAL_SEPARATION")) != 0)
[558]348    {
[1110]349        _splitStereoVerticalSeparation = atoi(ptr);
[558]350    }
351
[434]352    if( (ptr = getenv("OSG_MAX_NUMBER_OF_GRAPHICS_CONTEXTS")) != 0)
353    {
[469]354        _maxNumOfGraphicsContexts = atoi(ptr);
[434]355    }
[7215]356
357    if( (ptr = getenv("OSG_COMPIlE_CONTEXTS")) != 0)
358    {
359        if (strcmp(ptr,"OFF")==0)
360        {
361            _compileContextsHint = false;
362        }
363        else
364        if (strcmp(ptr,"ON")==0)
365        {
366            _compileContextsHint = true;
367        }
368    }
[7274]369   
370    if( (ptr = getenv("OSG_SERIALIZE_DRAW_DISPATCH")) != 0)
371    {
372        if (strcmp(ptr,"OFF")==0)
373        {
374            _serializeDrawDispatch = false;
375        }
376        else
377        if (strcmp(ptr,"ON")==0)
378        {
379            _serializeDrawDispatch = true;
380        }
381    }
382
[9055]383    if( (ptr = getenv("OSG_NUM_DATABASE_THREADS")) != 0)
384    {
385        _numDatabaseThreadsHint = atoi(ptr);
386    }
387
388    if( (ptr = getenv("OSG_NUM_HTTP_DATABASE_THREADS")) != 0)
389    {
390        _numHttpDatabaseThreadsHint = atoi(ptr);
391    }
[9973]392
393    if( (ptr = getenv("OSG_MULTI_SAMPLES")) != 0)
394    {
395        _numMultiSamples = atoi(ptr);
396    }
[10588]397
398    if( (ptr = getenv("OSG_TEXTURE_POOL_SIZE")) != 0)
399    {
400        _maxTexturePoolSize = atoi(ptr);
401    }
402
[10601]403    if( (ptr = getenv("OSG_BUFFER_OBJECT_POOL_SIZE")) != 0)
[10588]404    {
[10601]405        _maxBufferObjectPoolSize = atoi(ptr);
[10588]406    }
[235]407}
408
[1613]409void DisplaySettings::readCommandLine(ArgumentParser& arguments)
[1610]410{
[9191]411    if (_application.empty()) _application = arguments[0];
[1613]412
413    // report the usage options.
414    if (arguments.getApplicationUsage())
415    {
[2336]416        arguments.getApplicationUsage()->addCommandLineOption("--display <type>","MONITOR | POWERWALL | REALITY_CENTER | HEAD_MOUNTED_DISPLAY");
[1613]417        arguments.getApplicationUsage()->addCommandLineOption("--stereo","Use default stereo mode which is ANAGLYPHIC if not overriden by environmental variable");
[7277]418        arguments.getApplicationUsage()->addCommandLineOption("--stereo <mode>","ANAGLYPHIC | QUAD_BUFFER | HORIZONTAL_SPLIT | VERTICAL_SPLIT | LEFT_EYE | RIGHT_EYE | HORIZONTAL_INTERLACE | VERTICAL_INTERLACE | CHECKERBOARD | ON | OFF ");
[1613]419        arguments.getApplicationUsage()->addCommandLineOption("--rgba","Request a RGBA color buffer visual");
420        arguments.getApplicationUsage()->addCommandLineOption("--stencil","Request a stencil buffer visual");
[4845]421        arguments.getApplicationUsage()->addCommandLineOption("--accum-rgb","Request a rgb accumulator buffer visual");
422        arguments.getApplicationUsage()->addCommandLineOption("--accum-rgba","Request a rgb accumulator buffer visual");
[5043]423        arguments.getApplicationUsage()->addCommandLineOption("--samples <num>","Request a multisample visual");
[7215]424        arguments.getApplicationUsage()->addCommandLineOption("--cc","Request use of compile contexts and threads");
[7274]425        arguments.getApplicationUsage()->addCommandLineOption("--serialize-draw <mode>","OFF | ON - set the serialization of draw dispatch");
[1613]426    }
427
[2336]428    std::string str;
429    while(arguments.read("--display",str))
430    {
431        if (str=="MONITOR") _displayType = MONITOR;
432        else if (str=="POWERWALL") _displayType = POWERWALL;
433        else if (str=="REALITY_CENTER") _displayType = REALITY_CENTER;
434        else if (str=="HEAD_MOUNTED_DISPLAY") _displayType = HEAD_MOUNTED_DISPLAY;
435    }
[1613]436
[1610]437    int pos;
[9100]438    while ((pos=arguments.find("--stereo"))>0)
[1610]439    {
[1613]440        if (arguments.match(pos+1,"ANAGLYPHIC"))            { arguments.remove(pos,2); _stereo = true;_stereoMode = ANAGLYPHIC; }
441        else if (arguments.match(pos+1,"QUAD_BUFFER"))      { arguments.remove(pos,2); _stereo = true;_stereoMode = QUAD_BUFFER; }
442        else if (arguments.match(pos+1,"HORIZONTAL_SPLIT")) { arguments.remove(pos,2); _stereo = true;_stereoMode = HORIZONTAL_SPLIT; }
443        else if (arguments.match(pos+1,"VERTICAL_SPLIT"))   { arguments.remove(pos,2); _stereo = true;_stereoMode = VERTICAL_SPLIT; }
[4614]444        else if (arguments.match(pos+1,"HORIZONTAL_INTERLACE")) { arguments.remove(pos,2); _stereo = true;_stereoMode = HORIZONTAL_INTERLACE; }
445        else if (arguments.match(pos+1,"VERTICAL_INTERLACE"))   { arguments.remove(pos,2); _stereo = true;_stereoMode = VERTICAL_INTERLACE; }
[7277]446        else if (arguments.match(pos+1,"CHECKERBOARD"))     { arguments.remove(pos,2); _stereo = true;_stereoMode = CHECKERBOARD; }
[1613]447        else if (arguments.match(pos+1,"LEFT_EYE"))         { arguments.remove(pos,2); _stereo = true;_stereoMode = LEFT_EYE; }
448        else if (arguments.match(pos+1,"RIGHT_EYE"))        { arguments.remove(pos,2); _stereo = true;_stereoMode = RIGHT_EYE; }
449        else if (arguments.match(pos+1,"ON"))               { arguments.remove(pos,2); _stereo = true; }
450        else if (arguments.match(pos+1,"OFF"))              { arguments.remove(pos,2); _stereo = false; }
451        else                                                { arguments.remove(pos); _stereo = true; }
[1610]452    }
453
[1613]454    while (arguments.read("--rgba"))
[1610]455    {
456        _RGB = true;
457        _minimumNumberAlphaBits = 1;
458    }           
459
[1613]460    while (arguments.read("--stencil"))
[1610]461    {
462        _minimumNumberStencilBits = 1;
463    }
[4665]464
465    while (arguments.read("--accum-rgb"))
466    {
467        setMinimumNumAccumBits(8,8,8,0);
468    }
469
470    while (arguments.read("--accum-rgba"))
471    {
472        setMinimumNumAccumBits(8,8,8,8);
473    }
[5043]474
475    while(arguments.read("--samples",str))
476    {
477        _numMultiSamples = atoi(str.c_str());
478    }
[7215]479
480    while(arguments.read("--cc"))
481    {
482        _compileContextsHint = true;
483    }
484
[7274]485    while(arguments.read("--serialize-draw",str))
486    {
487        if (str=="ON") _serializeDrawDispatch = true;
488        else if (str=="OFF") _serializeDrawDispatch = false;
489    }
490
[9055]491    while(arguments.read("--num-db-threads",_numDatabaseThreadsHint)) {}
492    while(arguments.read("--num-http-threads",_numHttpDatabaseThreadsHint)) {}
[10588]493
494    while(arguments.read("--texture-pool-size",_maxTexturePoolSize)) {}
[10601]495    while(arguments.read("--buffer-object-pool-size",_maxBufferObjectPoolSize)) {}
[10588]496
[1610]497}
[10588]498
499
Note: See TracBrowser for help on using the browser.