Added support for specificing the eye mapping and seperation between the

horizontal and veritical split stereo modes.

Renamed osg::Image::ensureDimensionArePowerOfTwo() to osg::Image::ensureValidSizeForTexturing().
This commit is contained in:
Robert Osfield
2002-04-14 22:21:59 +00:00
parent 22e8047869
commit c43607c14d
6 changed files with 145 additions and 42 deletions

View File

@@ -49,6 +49,12 @@ void DisplaySettings::copy(const DisplaySettings& vs)
_screenDistance = vs._screenDistance;
_screenHeight = vs._screenHeight;
_splitStereoHorizontalEyeMapping = vs._splitStereoHorizontalEyeMapping;
_splitStereoHorizontalSeperation = vs._splitStereoHorizontalSeperation;
_splitStereoVerticalEyeMapping = vs._splitStereoVerticalEyeMapping;
_splitStereoVerticalSeperation = vs._splitStereoVerticalSeperation;
_doubleBuffer = vs._doubleBuffer;
_RGB = vs._RGB;
_depthBuffer = vs._depthBuffer;
@@ -80,6 +86,12 @@ void DisplaySettings::setDefaults()
_screenDistance = 0.5f;
_screenHeight = 0.26f;
_splitStereoHorizontalEyeMapping = LEFT_EYE_LEFT_VIEWPORT;
_splitStereoHorizontalSeperation = 42;
_splitStereoVerticalEyeMapping = LEFT_EYE_TOP_VIEWPORT;
_splitStereoVerticalSeperation = 42;
_doubleBuffer = true;
_RGB = true;
_depthBuffer = true;
@@ -147,6 +159,43 @@ void DisplaySettings::readEnvironmentalVariables()
_screenHeight = atof(ptr);
}
if( (ptr = getenv("OSG_SPLIT_STEREO_HORIZONTAL_EYE_MAPPING")) != 0)
{
if (strcmp(ptr,"LEFT_EYE_LEFT_VIEWPORT")==0)
{
_splitStereoHorizontalEyeMapping = LEFT_EYE_LEFT_VIEWPORT;
}
else
if (strcmp(ptr,"LEFT_EYE_RIGHT_VIEWPORT")==0)
{
_splitStereoHorizontalEyeMapping = LEFT_EYE_RIGHT_VIEWPORT;
}
}
if( (ptr = getenv("OSG_SPLIT_STEREO_HORIZONTAL_SEPERATION")) != 0)
{
_splitStereoHorizontalSeperation = atoi(ptr);
}
if( (ptr = getenv("OSG_SPLIT_STEREO_VERTICAL_EYE_MAPPING")) != 0)
{
if (strcmp(ptr,"LEFT_EYE_TOP_VIEWPORT")==0)
{
_splitStereoVerticalEyeMapping = LEFT_EYE_TOP_VIEWPORT;
}
else
if (strcmp(ptr,"LEFT_EYE_BOTTOM_VIEWPORT")==0)
{
_splitStereoVerticalEyeMapping = LEFT_EYE_BOTTOM_VIEWPORT;
}
}
if( (ptr = getenv("OSG_SPLIT_STEREO_VERTICAL_SEPERATION")) != 0)
{
_splitStereoVerticalSeperation = atoi(ptr);
}
if( (ptr = getenv("OSG_MAX_NUMBER_OF_GRAPHICS_CONTEXTS")) != 0)
{
_maxNumOfGraphicsContexts = atoi(ptr);