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

Revision 10588, 19.3 kB (checked in by robert, 4 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
Line 
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
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*/
13#include <osg/DisplaySettings>
14#include <osg/ArgumentParser>
15#include <osg/ApplicationUsage>
16#include <osg/Math>
17#include <osg/Notify>
18#include <osg/ref_ptr>
19
20#include <algorithm>
21#include <string.h>
22
23using namespace osg;
24using namespace std;
25
26DisplaySettings* DisplaySettings::instance()
27{
28    static ref_ptr<DisplaySettings> s_displaySettings = new DisplaySettings;
29    return s_displaySettings.get();
30}
31
32DisplaySettings::DisplaySettings(const DisplaySettings& vs):Referenced(true)
33{
34    setDisplaySettings(vs);
35}
36
37DisplaySettings::~DisplaySettings()
38{
39}
40
41 
42 DisplaySettings& DisplaySettings::operator = (const DisplaySettings& vs)
43{
44    if (this==&vs) return *this;
45    setDisplaySettings(vs);
46    return *this;
47}
48
49void DisplaySettings::setDisplaySettings(const DisplaySettings& vs)
50{
51    _displayType = vs._displayType;
52    _stereo = vs._stereo;
53    _stereoMode = vs._stereoMode;
54    _eyeSeparation = vs._eyeSeparation;
55    _screenWidth = vs._screenWidth;
56    _screenHeight = vs._screenHeight;
57    _screenDistance = vs._screenDistance;
58
59    _splitStereoHorizontalEyeMapping = vs._splitStereoHorizontalEyeMapping;
60    _splitStereoHorizontalSeparation = vs._splitStereoHorizontalSeparation;
61
62    _splitStereoVerticalEyeMapping = vs._splitStereoVerticalEyeMapping;
63    _splitStereoVerticalSeparation = vs._splitStereoVerticalSeparation;
64   
65    _splitStereoAutoAdjustAspectRatio = vs._splitStereoAutoAdjustAspectRatio;
66
67    _doubleBuffer = vs._doubleBuffer;
68    _RGB = vs._RGB;
69    _depthBuffer = vs._depthBuffer;
70    _minimumNumberAlphaBits = vs._minimumNumberAlphaBits;
71    _minimumNumberStencilBits = vs._minimumNumberStencilBits;
72
73    _maxNumOfGraphicsContexts = vs._maxNumOfGraphicsContexts;
74    _numMultiSamples = vs._numMultiSamples;
75   
76    _compileContextsHint = vs._compileContextsHint;
77    _serializeDrawDispatch = vs._serializeDrawDispatch;
78   
79    _numDatabaseThreadsHint = vs._numDatabaseThreadsHint;
80    _numHttpDatabaseThreadsHint = vs._numHttpDatabaseThreadsHint;
81   
82    _application = vs._application;
83
84    _maxTexturePoolSize = vs._maxTexturePoolSize;
85    _maxVBOPoolSize = vs._maxVBOPoolSize;
86    _maxFBOPoolSize = vs._maxFBOPoolSize;
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;
101    if (vs._numMultiSamples>_numMultiSamples) _numMultiSamples = vs._numMultiSamples;
102
103    if (vs._compileContextsHint) _compileContextsHint = vs._compileContextsHint;
104    if (vs._serializeDrawDispatch) _serializeDrawDispatch = vs._serializeDrawDispatch;
105
106    if (vs._numDatabaseThreadsHint>_numDatabaseThreadsHint) _numDatabaseThreadsHint = vs._numDatabaseThreadsHint;
107    if (vs._numHttpDatabaseThreadsHint>_numHttpDatabaseThreadsHint) _numHttpDatabaseThreadsHint = vs._numHttpDatabaseThreadsHint;
108
109    if (_application.empty()) _application = vs._application;
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;
114}
115
116void DisplaySettings::setDefaults()
117{
118    _displayType = MONITOR;
119
120    _stereo = false;
121    _stereoMode = ANAGLYPHIC;
122    _eyeSeparation = 0.05f;
123    _screenWidth = 0.325f;
124    _screenHeight = 0.26f;
125    _screenDistance = 0.5f;
126
127    _splitStereoHorizontalEyeMapping = LEFT_EYE_LEFT_VIEWPORT;
128    _splitStereoHorizontalSeparation = 0;
129
130    _splitStereoVerticalEyeMapping = LEFT_EYE_TOP_VIEWPORT;
131    _splitStereoVerticalSeparation = 0;
132
133    _splitStereoAutoAdjustAspectRatio = true;
134
135    _doubleBuffer = true;
136    _RGB = true;
137    _depthBuffer = true;
138    _minimumNumberAlphaBits = 0;
139    _minimumNumberStencilBits = 0;
140    _minimumNumberAccumRedBits = 0;
141    _minimumNumberAccumGreenBits = 0;
142    _minimumNumberAccumBlueBits = 0;
143    _minimumNumberAccumAlphaBits = 0;
144   
145    _maxNumOfGraphicsContexts = 32;
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
152   
153    _compileContextsHint = false;
154    _serializeDrawDispatch = true;
155
156    _numDatabaseThreadsHint = 2;
157    _numHttpDatabaseThreadsHint = 1;
158
159    _maxTexturePoolSize = 0;
160    _maxVBOPoolSize = 0;
161    _maxFBOPoolSize = 0;
162}
163
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
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
183static ApplicationUsageProxy DisplaySetting_e0(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_DISPLAY_TYPE <type>","MONITOR | POWERWALL | REALITY_CENTER | HEAD_MOUNTED_DISPLAY");
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");
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");
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.");
196static ApplicationUsageProxy DisplaySetting_e13(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_COMPILE_CONTEXTS <mode>","OFF | ON Enable/disable the use a backgrouind compile contexts and threads.");
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.");
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.");
200static ApplicationUsageProxy DisplaySetting_e17(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MULTI_SAMPLES <int>","Set the hint for the number of samples to use when multi-sampling.");
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.");
204
205void DisplaySettings::readEnvironmentalVariables()
206{
207    const char* ptr = 0;
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   
232    if( (ptr = getenv("OSG_STEREO_MODE")) != 0)
233    {
234        if (strcmp(ptr,"QUAD_BUFFER")==0)
235        {
236            _stereoMode = QUAD_BUFFER;
237        }
238        else if (strcmp(ptr,"ANAGLYPHIC")==0)
239        {
240            _stereoMode = ANAGLYPHIC;
241        }
242        else if (strcmp(ptr,"HORIZONTAL_SPLIT")==0)
243        {
244            _stereoMode = HORIZONTAL_SPLIT;
245        }
246        else if (strcmp(ptr,"VERTICAL_SPLIT")==0)
247        {
248            _stereoMode = VERTICAL_SPLIT;
249        }
250        else if (strcmp(ptr,"LEFT_EYE")==0)
251        {
252            _stereoMode = LEFT_EYE;
253        }
254        else if (strcmp(ptr,"RIGHT_EYE")==0)
255        {
256            _stereoMode = RIGHT_EYE;
257        }
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        }
266        else if (strcmp(ptr,"CHECKERBOARD")==0)
267        {
268            _stereoMode = CHECKERBOARD;
269        }
270    }
271
272    if( (ptr = getenv("OSG_STEREO")) != 0)
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
285    if( (ptr = getenv("OSG_EYE_SEPARATION")) != 0)
286    {
287        _eyeSeparation = osg::asciiToFloat(ptr);
288    }
289
290    if( (ptr = getenv("OSG_SCREEN_WIDTH")) != 0)
291    {
292        _screenWidth = osg::asciiToFloat(ptr);
293    }
294
295    if( (ptr = getenv("OSG_SCREEN_HEIGHT")) != 0)
296    {
297        _screenHeight = osg::asciiToFloat(ptr);
298    }
299
300    if( (ptr = getenv("OSG_SCREEN_DISTANCE")) != 0)
301    {
302        _screenDistance = osg::asciiToFloat(ptr);
303    }
304
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
318    if( (ptr = getenv("OSG_SPLIT_STEREO_HORIZONTAL_SEPARATION")) != 0)
319    {
320        _splitStereoHorizontalSeparation = atoi(ptr);
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    }
336   
337    if( (ptr = getenv("OSG_SPLIT_STEREO_AUTO_ADJUST_ASPECT_RATIO")) != 0)
338    {
339        if (strcmp(ptr,"OFF")==0)
340        {
341            _splitStereoAutoAdjustAspectRatio = false;
342        }
343        else
344        if (strcmp(ptr,"ON")==0)
345        {
346            _splitStereoAutoAdjustAspectRatio = true;
347        }
348    }
349
350    if( (ptr = getenv("OSG_SPLIT_STEREO_VERTICAL_SEPARATION")) != 0)
351    {
352        _splitStereoVerticalSeparation = atoi(ptr);
353    }
354
355    if( (ptr = getenv("OSG_MAX_NUMBER_OF_GRAPHICS_CONTEXTS")) != 0)
356    {
357        _maxNumOfGraphicsContexts = atoi(ptr);
358    }
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    }
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
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    }
395
396    if( (ptr = getenv("OSG_MULTI_SAMPLES")) != 0)
397    {
398        _numMultiSamples = atoi(ptr);
399    }
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    }
415}
416
417void DisplaySettings::readCommandLine(ArgumentParser& arguments)
418{
419    if (_application.empty()) _application = arguments[0];
420
421    // report the usage options.
422    if (arguments.getApplicationUsage())
423    {
424        arguments.getApplicationUsage()->addCommandLineOption("--display <type>","MONITOR | POWERWALL | REALITY_CENTER | HEAD_MOUNTED_DISPLAY");
425        arguments.getApplicationUsage()->addCommandLineOption("--stereo","Use default stereo mode which is ANAGLYPHIC if not overriden by environmental variable");
426        arguments.getApplicationUsage()->addCommandLineOption("--stereo <mode>","ANAGLYPHIC | QUAD_BUFFER | HORIZONTAL_SPLIT | VERTICAL_SPLIT | LEFT_EYE | RIGHT_EYE | HORIZONTAL_INTERLACE | VERTICAL_INTERLACE | CHECKERBOARD | ON | OFF ");
427        arguments.getApplicationUsage()->addCommandLineOption("--rgba","Request a RGBA color buffer visual");
428        arguments.getApplicationUsage()->addCommandLineOption("--stencil","Request a stencil buffer visual");
429        arguments.getApplicationUsage()->addCommandLineOption("--accum-rgb","Request a rgb accumulator buffer visual");
430        arguments.getApplicationUsage()->addCommandLineOption("--accum-rgba","Request a rgb accumulator buffer visual");
431        arguments.getApplicationUsage()->addCommandLineOption("--samples <num>","Request a multisample visual");
432        arguments.getApplicationUsage()->addCommandLineOption("--cc","Request use of compile contexts and threads");
433        arguments.getApplicationUsage()->addCommandLineOption("--serialize-draw <mode>","OFF | ON - set the serialization of draw dispatch");
434    }
435
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    }
444
445    int pos;
446    while ((pos=arguments.find("--stereo"))>0)
447    {
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; }
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; }
454        else if (arguments.match(pos+1,"CHECKERBOARD"))     { arguments.remove(pos,2); _stereo = true;_stereoMode = CHECKERBOARD; }
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; }
460    }
461
462    while (arguments.read("--rgba"))
463    {
464        _RGB = true;
465        _minimumNumberAlphaBits = 1;
466    }           
467
468    while (arguments.read("--stencil"))
469    {
470        _minimumNumberStencilBits = 1;
471    }
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    }
482
483    while(arguments.read("--samples",str))
484    {
485        _numMultiSamples = atoi(str.c_str());
486    }
487
488    while(arguments.read("--cc"))
489    {
490        _compileContextsHint = true;
491    }
492
493    while(arguments.read("--serialize-draw",str))
494    {
495        if (str=="ON") _serializeDrawDispatch = true;
496        else if (str=="OFF") _serializeDrawDispatch = false;
497    }
498
499    while(arguments.read("--num-db-threads",_numDatabaseThreadsHint)) {}
500    while(arguments.read("--num-http-threads",_numHttpDatabaseThreadsHint)) {}
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
506}
507
508
Note: See TracBrowser for help on using the browser.