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

Revision 10588, 19.3 kB (checked in by robert, 5 years ago)

Preliminary work on support for a texture object pool that is designed to help manage resources down the GPU more tightly.

  • 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;
85    _maxVBOPoolSize = vs._maxVBOPoolSize;
86    _maxFBOPoolSize = vs._maxFBOPoolSize;
[235]87}
88
89void DisplaySettings::merge(const DisplaySettings& vs)
90{
91    if (_stereo       || vs._stereo)        _stereo = true;
92   
93    // need to think what to do about merging the stereo mode.
94   
95    if (_doubleBuffer || vs._doubleBuffer)  _doubleBuffer = true;
96    if (_RGB          || vs._RGB)           _RGB = true;
97    if (_depthBuffer  || vs._depthBuffer)   _depthBuffer = true;
98   
99    if (vs._minimumNumberAlphaBits>_minimumNumberAlphaBits) _minimumNumberAlphaBits = vs._minimumNumberAlphaBits;
100    if (vs._minimumNumberStencilBits>_minimumNumberStencilBits) _minimumNumberStencilBits = vs._minimumNumberStencilBits;
[5043]101    if (vs._numMultiSamples>_numMultiSamples) _numMultiSamples = vs._numMultiSamples;
[7215]102
103    if (vs._compileContextsHint) _compileContextsHint = vs._compileContextsHint;
[7274]104    if (vs._serializeDrawDispatch) _serializeDrawDispatch = vs._serializeDrawDispatch;
[9055]105
106    if (vs._numDatabaseThreadsHint>_numDatabaseThreadsHint) _numDatabaseThreadsHint = vs._numDatabaseThreadsHint;
107    if (vs._numHttpDatabaseThreadsHint>_numHttpDatabaseThreadsHint) _numHttpDatabaseThreadsHint = vs._numHttpDatabaseThreadsHint;
[9191]108
109    if (_application.empty()) _application = vs._application;
[10588]110
111    if (vs._maxTexturePoolSize>_maxTexturePoolSize) _maxTexturePoolSize = vs._maxTexturePoolSize;
112    if (vs._maxVBOPoolSize>_maxVBOPoolSize) _maxVBOPoolSize = vs._maxVBOPoolSize;
113    if (vs._maxFBOPoolSize>_maxFBOPoolSize) _maxFBOPoolSize = vs._maxFBOPoolSize;
[235]114}
115
116void DisplaySettings::setDefaults()
117{
[2336]118    _displayType = MONITOR;
119
[235]120    _stereo = false;
121    _stereoMode = ANAGLYPHIC;
[1110]122    _eyeSeparation = 0.05f;
[2413]123    _screenWidth = 0.325f;
124    _screenHeight = 0.26f;
[235]125    _screenDistance = 0.5f;
126
[558]127    _splitStereoHorizontalEyeMapping = LEFT_EYE_LEFT_VIEWPORT;
[1977]128    _splitStereoHorizontalSeparation = 0;
[558]129
130    _splitStereoVerticalEyeMapping = LEFT_EYE_TOP_VIEWPORT;
[1977]131    _splitStereoVerticalSeparation = 0;
[558]132
[1979]133    _splitStereoAutoAdjustAspectRatio = true;
134
[235]135    _doubleBuffer = true;
136    _RGB = true;
137    _depthBuffer = true;
138    _minimumNumberAlphaBits = 0;
139    _minimumNumberStencilBits = 0;
[4665]140    _minimumNumberAccumRedBits = 0;
141    _minimumNumberAccumGreenBits = 0;
142    _minimumNumberAccumBlueBits = 0;
143    _minimumNumberAccumAlphaBits = 0;
[434]144   
[5358]145    _maxNumOfGraphicsContexts = 32;
[5043]146    _numMultiSamples = 0;
147
148    #ifdef __sgi
149    // switch on anti-aliasing by default, just in case we have an Onyx :-)
150    _numMultiSamples = 4;
151    #endif
[7215]152   
153    _compileContextsHint = false;
[7274]154    _serializeDrawDispatch = true;
[9055]155
156    _numDatabaseThreadsHint = 2;
157    _numHttpDatabaseThreadsHint = 1;
[10588]158
159    _maxTexturePoolSize = 0;
160    _maxVBOPoolSize = 0;
161    _maxFBOPoolSize = 0;
[235]162}
163
[5358]164void DisplaySettings::setMaxNumberOfGraphicsContexts(unsigned int num)
165{
166    _maxNumOfGraphicsContexts = num;
167}
168
169unsigned int DisplaySettings::getMaxNumberOfGraphicsContexts() const
170{
171    // osg::notify(osg::NOTICE)<<"getMaxNumberOfGraphicsContexts()="<<_maxNumOfGraphicsContexts<<std::endl;
172    return _maxNumOfGraphicsContexts;
173}
174
[4665]175void DisplaySettings::setMinimumNumAccumBits(unsigned int red, unsigned int green, unsigned int blue, unsigned int alpha)
176{
177    _minimumNumberAccumRedBits = red;
178    _minimumNumberAccumGreenBits = green;
179    _minimumNumberAccumBlueBits = blue;
180    _minimumNumberAccumAlphaBits = alpha;
181}
182
[2336]183static ApplicationUsageProxy DisplaySetting_e0(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_DISPLAY_TYPE <type>","MONITOR | POWERWALL | REALITY_CENTER | HEAD_MOUNTED_DISPLAY");
[4613]184static 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]185static ApplicationUsageProxy DisplaySetting_e2(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_STEREO <mode>","OFF | ON");
186static ApplicationUsageProxy DisplaySetting_e3(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_EYE_SEPARATION <float>","physical distance between eyes");
187static ApplicationUsageProxy DisplaySetting_e4(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SCREEN_DISTANCE <float>","physical distance between eyes and screen");
188static ApplicationUsageProxy DisplaySetting_e5(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SCREEN_HEIGHT <float>","physical screen height");
[3714]189static ApplicationUsageProxy DisplaySetting_e6(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SCREEN_WIDTH <float>","physical screen width");
190static ApplicationUsageProxy DisplaySetting_e7(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SPLIT_STEREO_HORIZONTAL_EYE_MAPPING <mode>","LEFT_EYE_LEFT_VIEWPORT | LEFT_EYE_RIGHT_VIEWPORT");
191static ApplicationUsageProxy DisplaySetting_e8(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SPLIT_STEREO_HORIZONTAL_SEPARATION <float>","number of pixels between viewports");
192static ApplicationUsageProxy DisplaySetting_e9(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SPLIT_STEREO_VERTICAL_EYE_MAPPING <mode>","LEFT_EYE_TOP_VIEWPORT | LEFT_EYE_BOTTOM_VIEWPORT");
193static 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.");
194static ApplicationUsageProxy DisplaySetting_e11(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SPLIT_STEREO_VERTICAL_SEPARATION <float>","number of pixels between viewports");
195static ApplicationUsageProxy DisplaySetting_e12(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MAX_NUMBER_OF_GRAPHICS_CONTEXTS <int>","maximum number of graphics contexts to be used with applications.");
[9807]196static ApplicationUsageProxy DisplaySetting_e13(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_COMPILE_CONTEXTS <mode>","OFF | ON Enable/disable the use a backgrouind compile contexts and threads.");
[7274]197static 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]198static 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.");
199static 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]200static ApplicationUsageProxy DisplaySetting_e17(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MULTI_SAMPLES <int>","Set the hint for the number of samples to use when multi-sampling.");
[10588]201static ApplicationUsageProxy DisplaySetting_e18(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_TEXTURE_POOL_SIZE <int>","Set the hint size of texture pool to manage.");
202static ApplicationUsageProxy DisplaySetting_e19(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_VBO_POOL_SIZE <int>","Set the hint size of vertex buffer object pool to manage.");
203static ApplicationUsageProxy DisplaySetting_e20(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_FBO_POOL_SIZE <int>","Set the hint size of frame buffer object pool to manage.");
[7274]204
[235]205void DisplaySettings::readEnvironmentalVariables()
206{
[4310]207    const char* ptr = 0;
[2336]208   
209    if ((ptr = getenv("OSG_DISPLAY_TYPE")) != 0)
210    {
211        if (strcmp(ptr,"MONITOR")==0)
212        {
213            _displayType = MONITOR;
214        }
215        else
216        if (strcmp(ptr,"POWERWALL")==0)
217        {
218            _displayType = POWERWALL;
219        }
220        else
221        if (strcmp(ptr,"REALITY_CENTER")==0)
222        {
223            _displayType = REALITY_CENTER;
224        }
225        else
226        if (strcmp(ptr,"HEAD_MOUNTED_DISPLAY")==0)
227        {
228            _displayType = HEAD_MOUNTED_DISPLAY;
229        }
230    }
231   
[339]232    if( (ptr = getenv("OSG_STEREO_MODE")) != 0)
[235]233    {
234        if (strcmp(ptr,"QUAD_BUFFER")==0)
235        {
236            _stereoMode = QUAD_BUFFER;
237        }
[4613]238        else if (strcmp(ptr,"ANAGLYPHIC")==0)
[235]239        {
240            _stereoMode = ANAGLYPHIC;
241        }
[4613]242        else if (strcmp(ptr,"HORIZONTAL_SPLIT")==0)
[235]243        {
244            _stereoMode = HORIZONTAL_SPLIT;
245        }
[4613]246        else if (strcmp(ptr,"VERTICAL_SPLIT")==0)
[235]247        {
248            _stereoMode = VERTICAL_SPLIT;
249        }
[4613]250        else if (strcmp(ptr,"LEFT_EYE")==0)
[1307]251        {
252            _stereoMode = LEFT_EYE;
253        }
[4613]254        else if (strcmp(ptr,"RIGHT_EYE")==0)
[1307]255        {
256            _stereoMode = RIGHT_EYE;
257        }
[4613]258        else if (strcmp(ptr,"HORIZONTAL_INTERLACE")==0)
259        {
260            _stereoMode = HORIZONTAL_INTERLACE;
261        }
262        else if (strcmp(ptr,"VERTICAL_INTERLACE")==0)
263        {
264            _stereoMode = VERTICAL_INTERLACE;
265        }
[7277]266        else if (strcmp(ptr,"CHECKERBOARD")==0)
267        {
268            _stereoMode = CHECKERBOARD;
269        }
[235]270    }
271
[339]272    if( (ptr = getenv("OSG_STEREO")) != 0)
[235]273    {
274        if (strcmp(ptr,"OFF")==0)
275        {
276            _stereo = false;
277        }
278        else
279        if (strcmp(ptr,"ON")==0)
280        {
281            _stereo = true;
282        }
283    }
284
[1110]285    if( (ptr = getenv("OSG_EYE_SEPARATION")) != 0)
[235]286    {
[10415]287        _eyeSeparation = osg::asciiToFloat(ptr);
[235]288    }
289
[2413]290    if( (ptr = getenv("OSG_SCREEN_WIDTH")) != 0)
[235]291    {
[10415]292        _screenWidth = osg::asciiToFloat(ptr);
[235]293    }
294
[339]295    if( (ptr = getenv("OSG_SCREEN_HEIGHT")) != 0)
[235]296    {
[10415]297        _screenHeight = osg::asciiToFloat(ptr);
[235]298    }
[434]299
[2413]300    if( (ptr = getenv("OSG_SCREEN_DISTANCE")) != 0)
301    {
[10415]302        _screenDistance = osg::asciiToFloat(ptr);
[2413]303    }
304
[558]305    if( (ptr = getenv("OSG_SPLIT_STEREO_HORIZONTAL_EYE_MAPPING")) != 0)
306    {
307        if (strcmp(ptr,"LEFT_EYE_LEFT_VIEWPORT")==0)
308        {
309            _splitStereoHorizontalEyeMapping = LEFT_EYE_LEFT_VIEWPORT;
310        }
311        else
312        if (strcmp(ptr,"LEFT_EYE_RIGHT_VIEWPORT")==0)
313        {
314            _splitStereoHorizontalEyeMapping = LEFT_EYE_RIGHT_VIEWPORT;
315        }
316    }
317
[1110]318    if( (ptr = getenv("OSG_SPLIT_STEREO_HORIZONTAL_SEPARATION")) != 0)
[558]319    {
[1110]320        _splitStereoHorizontalSeparation = atoi(ptr);
[558]321    }
322
323
324    if( (ptr = getenv("OSG_SPLIT_STEREO_VERTICAL_EYE_MAPPING")) != 0)
325    {
326        if (strcmp(ptr,"LEFT_EYE_TOP_VIEWPORT")==0)
327        {
328            _splitStereoVerticalEyeMapping = LEFT_EYE_TOP_VIEWPORT;
329        }
330        else
331        if (strcmp(ptr,"LEFT_EYE_BOTTOM_VIEWPORT")==0)
332        {
333            _splitStereoVerticalEyeMapping = LEFT_EYE_BOTTOM_VIEWPORT;
334        }
335    }
[1979]336   
337    if( (ptr = getenv("OSG_SPLIT_STEREO_AUTO_ADJUST_ASPECT_RATIO")) != 0)
338    {
339        if (strcmp(ptr,"OFF")==0)
340        {
[2428]341            _splitStereoAutoAdjustAspectRatio = false;
[1979]342        }
343        else
344        if (strcmp(ptr,"ON")==0)
345        {
[2428]346            _splitStereoAutoAdjustAspectRatio = true;
[1979]347        }
348    }
[558]349
[1110]350    if( (ptr = getenv("OSG_SPLIT_STEREO_VERTICAL_SEPARATION")) != 0)
[558]351    {
[1110]352        _splitStereoVerticalSeparation = atoi(ptr);
[558]353    }
354
[434]355    if( (ptr = getenv("OSG_MAX_NUMBER_OF_GRAPHICS_CONTEXTS")) != 0)
356    {
[469]357        _maxNumOfGraphicsContexts = atoi(ptr);
[434]358    }
[7215]359
360    if( (ptr = getenv("OSG_COMPIlE_CONTEXTS")) != 0)
361    {
362        if (strcmp(ptr,"OFF")==0)
363        {
364            _compileContextsHint = false;
365        }
366        else
367        if (strcmp(ptr,"ON")==0)
368        {
369            _compileContextsHint = true;
370        }
371    }
[7274]372   
373    if( (ptr = getenv("OSG_SERIALIZE_DRAW_DISPATCH")) != 0)
374    {
375        if (strcmp(ptr,"OFF")==0)
376        {
377            _serializeDrawDispatch = false;
378        }
379        else
380        if (strcmp(ptr,"ON")==0)
381        {
382            _serializeDrawDispatch = true;
383        }
384    }
385
[9055]386    if( (ptr = getenv("OSG_NUM_DATABASE_THREADS")) != 0)
387    {
388        _numDatabaseThreadsHint = atoi(ptr);
389    }
390
391    if( (ptr = getenv("OSG_NUM_HTTP_DATABASE_THREADS")) != 0)
392    {
393        _numHttpDatabaseThreadsHint = atoi(ptr);
394    }
[9973]395
396    if( (ptr = getenv("OSG_MULTI_SAMPLES")) != 0)
397    {
398        _numMultiSamples = atoi(ptr);
399    }
[10588]400
401    if( (ptr = getenv("OSG_TEXTURE_POOL_SIZE")) != 0)
402    {
403        _maxTexturePoolSize = atoi(ptr);
404    }
405
406    if( (ptr = getenv("OSG_VBO_POOL_SIZE")) != 0)
407    {
408        _maxVBOPoolSize = atoi(ptr);
409    }
410
411    if( (ptr = getenv("OSG_FBO_POOL_SIZE")) != 0)
412    {
413        _maxFBOPoolSize = atoi(ptr);
414    }
[235]415}
416
[1613]417void DisplaySettings::readCommandLine(ArgumentParser& arguments)
[1610]418{
[9191]419    if (_application.empty()) _application = arguments[0];
[1613]420
421    // report the usage options.
422    if (arguments.getApplicationUsage())
423    {
[2336]424        arguments.getApplicationUsage()->addCommandLineOption("--display <type>","MONITOR | POWERWALL | REALITY_CENTER | HEAD_MOUNTED_DISPLAY");
[1613]425        arguments.getApplicationUsage()->addCommandLineOption("--stereo","Use default stereo mode which is ANAGLYPHIC if not overriden by environmental variable");
[7277]426        arguments.getApplicationUsage()->addCommandLineOption("--stereo <mode>","ANAGLYPHIC | QUAD_BUFFER | HORIZONTAL_SPLIT | VERTICAL_SPLIT | LEFT_EYE | RIGHT_EYE | HORIZONTAL_INTERLACE | VERTICAL_INTERLACE | CHECKERBOARD | ON | OFF ");
[1613]427        arguments.getApplicationUsage()->addCommandLineOption("--rgba","Request a RGBA color buffer visual");
428        arguments.getApplicationUsage()->addCommandLineOption("--stencil","Request a stencil buffer visual");
[4845]429        arguments.getApplicationUsage()->addCommandLineOption("--accum-rgb","Request a rgb accumulator buffer visual");
430        arguments.getApplicationUsage()->addCommandLineOption("--accum-rgba","Request a rgb accumulator buffer visual");
[5043]431        arguments.getApplicationUsage()->addCommandLineOption("--samples <num>","Request a multisample visual");
[7215]432        arguments.getApplicationUsage()->addCommandLineOption("--cc","Request use of compile contexts and threads");
[7274]433        arguments.getApplicationUsage()->addCommandLineOption("--serialize-draw <mode>","OFF | ON - set the serialization of draw dispatch");
[1613]434    }
435
[2336]436    std::string str;
437    while(arguments.read("--display",str))
438    {
439        if (str=="MONITOR") _displayType = MONITOR;
440        else if (str=="POWERWALL") _displayType = POWERWALL;
441        else if (str=="REALITY_CENTER") _displayType = REALITY_CENTER;
442        else if (str=="HEAD_MOUNTED_DISPLAY") _displayType = HEAD_MOUNTED_DISPLAY;
443    }
[1613]444
[1610]445    int pos;
[9100]446    while ((pos=arguments.find("--stereo"))>0)
[1610]447    {
[1613]448        if (arguments.match(pos+1,"ANAGLYPHIC"))            { arguments.remove(pos,2); _stereo = true;_stereoMode = ANAGLYPHIC; }
449        else if (arguments.match(pos+1,"QUAD_BUFFER"))      { arguments.remove(pos,2); _stereo = true;_stereoMode = QUAD_BUFFER; }
450        else if (arguments.match(pos+1,"HORIZONTAL_SPLIT")) { arguments.remove(pos,2); _stereo = true;_stereoMode = HORIZONTAL_SPLIT; }
451        else if (arguments.match(pos+1,"VERTICAL_SPLIT"))   { arguments.remove(pos,2); _stereo = true;_stereoMode = VERTICAL_SPLIT; }
[4614]452        else if (arguments.match(pos+1,"HORIZONTAL_INTERLACE")) { arguments.remove(pos,2); _stereo = true;_stereoMode = HORIZONTAL_INTERLACE; }
453        else if (arguments.match(pos+1,"VERTICAL_INTERLACE"))   { arguments.remove(pos,2); _stereo = true;_stereoMode = VERTICAL_INTERLACE; }
[7277]454        else if (arguments.match(pos+1,"CHECKERBOARD"))     { arguments.remove(pos,2); _stereo = true;_stereoMode = CHECKERBOARD; }
[1613]455        else if (arguments.match(pos+1,"LEFT_EYE"))         { arguments.remove(pos,2); _stereo = true;_stereoMode = LEFT_EYE; }
456        else if (arguments.match(pos+1,"RIGHT_EYE"))        { arguments.remove(pos,2); _stereo = true;_stereoMode = RIGHT_EYE; }
457        else if (arguments.match(pos+1,"ON"))               { arguments.remove(pos,2); _stereo = true; }
458        else if (arguments.match(pos+1,"OFF"))              { arguments.remove(pos,2); _stereo = false; }
459        else                                                { arguments.remove(pos); _stereo = true; }
[1610]460    }
461
[1613]462    while (arguments.read("--rgba"))
[1610]463    {
464        _RGB = true;
465        _minimumNumberAlphaBits = 1;
466    }           
467
[1613]468    while (arguments.read("--stencil"))
[1610]469    {
470        _minimumNumberStencilBits = 1;
471    }
[4665]472
473    while (arguments.read("--accum-rgb"))
474    {
475        setMinimumNumAccumBits(8,8,8,0);
476    }
477
478    while (arguments.read("--accum-rgba"))
479    {
480        setMinimumNumAccumBits(8,8,8,8);
481    }
[5043]482
483    while(arguments.read("--samples",str))
484    {
485        _numMultiSamples = atoi(str.c_str());
486    }
[7215]487
488    while(arguments.read("--cc"))
489    {
490        _compileContextsHint = true;
491    }
492
[7274]493    while(arguments.read("--serialize-draw",str))
494    {
495        if (str=="ON") _serializeDrawDispatch = true;
496        else if (str=="OFF") _serializeDrawDispatch = false;
497    }
498
[9055]499    while(arguments.read("--num-db-threads",_numDatabaseThreadsHint)) {}
500    while(arguments.read("--num-http-threads",_numHttpDatabaseThreadsHint)) {}
[10588]501
502    while(arguments.read("--texture-pool-size",_maxTexturePoolSize)) {}
503    while(arguments.read("--vbo-pool-size",_maxVBOPoolSize)) {}
504    while(arguments.read("--fbo-pool-size",_maxFBOPoolSize)) {}
505
[1610]506}
[10588]507
508
Note: See TracBrowser for help on using the browser.