Added Image::g/setOrigin to help movie plugins tell applications that the imagery

is not the usual OpenGL BOTTOM_LEFT orientation, but with the origin TOP_LEFT.  This
allows geometry setup code to flip the t tex coord to render the movie the correct way up.
This commit is contained in:
Robert Osfield
2007-06-12 16:55:44 +00:00
parent 26eb5672b9
commit a7a0e2c4d3
5 changed files with 31 additions and 3 deletions

View File

@@ -32,6 +32,7 @@ Image::Image()
setDataVariance(STATIC);
_fileName = "";
_origin = BOTTOM_LEFT;
_s = _t = _r = 0;
_internalTextureFormat = 0;
_pixelFormat = (unsigned int)0;
@@ -47,6 +48,7 @@ Image::Image()
Image::Image(const Image& image,const CopyOp& copyop):
Object(image,copyop),
_fileName(image._fileName),
_origin(image._origin),
_s(image._s), _t(image._t), _r(image._r),
_internalTextureFormat(image._internalTextureFormat),
_pixelFormat(image._pixelFormat),

View File

@@ -42,6 +42,8 @@ int QuicktimeImageStream::_qtInstanceCount = 0;
// Constructor: setup and start thread
QuicktimeImageStream::QuicktimeImageStream(std::string fileName) : ImageStream()
{
setOrigin(osg::Image::TOP_LEFT);
_len = 0;
_movieData = new MovieData();

View File

@@ -30,7 +30,10 @@ class XineImageStream : public osg::ImageStream
_visual(0),
_stream(0),
_event_queue(0),
_ready(false) {}
_ready(false)
{
setOrigin(osg::Image::TOP_LEFT);
}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
XineImageStream(const XineImageStream& image,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):