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

@@ -76,6 +76,30 @@ class SG_EXPORT DisplaySettings : public osg::Referenced
void setScreenDistance(const float distance) { _screenDistance = distance; }
const float getScreenDistance() const { return _screenDistance; }
enum SplitStereoHorizontalEyeMapping
{
LEFT_EYE_LEFT_VIEWPORT,
LEFT_EYE_RIGHT_VIEWPORT
};
void setSplitStereoHorizontalEyeMapping(SplitStereoHorizontalEyeMapping m) { _splitStereoHorizontalEyeMapping = m; }
SplitStereoHorizontalEyeMapping getSplitStereoHorizontalEyeMapping() const { return _splitStereoHorizontalEyeMapping; }
void setSplitStereoHorizontalSeperation(const int s) { _splitStereoHorizontalSeperation = s; }
const int getSplitStereoHorizontalSeperation() const { return _splitStereoHorizontalSeperation; }
enum SplitStereoVerticalEyeMapping
{
LEFT_EYE_TOP_VIEWPORT,
LEFT_EYE_BOTTOM_VIEWPORT,
};
void setSplitStereoVerticalEyeMapping(SplitStereoVerticalEyeMapping m) { _splitStereoVerticalEyeMapping = m; }
SplitStereoVerticalEyeMapping getSplitStereoVerticalEyeMapping() const { return _splitStereoVerticalEyeMapping; }
void setSplitStereoVerticalSeperation(const int s) { _splitStereoVerticalSeperation = s; }
const int getSplitStereoVerticalSeperation() const { return _splitStereoVerticalSeperation; }
void setScreenHeight(const float height) { _screenHeight = height; }
const float getScreenHeight() const { return _screenHeight; }
@@ -111,19 +135,24 @@ class SG_EXPORT DisplaySettings : public osg::Referenced
void copy(const DisplaySettings& vs);
bool _stereo;
StereoMode _stereoMode;
float _eyeSeperation;
float _screenDistance;
float _screenHeight;
bool _doubleBuffer;
bool _RGB;
bool _depthBuffer;
unsigned int _minimumNumberAlphaBits;
unsigned int _minimumNumberStencilBits;
bool _stereo;
StereoMode _stereoMode;
float _eyeSeperation;
float _screenDistance;
float _screenHeight;
int _maxNumOfGraphicsContexts;
SplitStereoHorizontalEyeMapping _splitStereoHorizontalEyeMapping;
int _splitStereoHorizontalSeperation;
SplitStereoVerticalEyeMapping _splitStereoVerticalEyeMapping;
int _splitStereoVerticalSeperation;
bool _doubleBuffer;
bool _RGB;
bool _depthBuffer;
unsigned int _minimumNumberAlphaBits;
unsigned int _minimumNumberStencilBits;
int _maxNumOfGraphicsContexts;
};

View File

@@ -110,9 +110,9 @@ class SG_EXPORT Image : public Object
/** Ensure image dimensions are a power of two.
* Mip Mapped texture require the image dimensions to be
* power of two.
*/
void ensureDimensionsArePowerOfTwo();
* power of two and are within the maxiumum texture size for
* the host machine.*/
void ensureValidSizeForTexturing();
/** Dirty the image, which increments the modified flag, to force osg::Texture to reload the image.*/
inline void dirty() { ++_modifiedTag; }