Exemplo n.º 1
0
    dp::util::ImageSharedPtr RenderTargetFBO::getImage( dp::PixelFormat pixelFormat, dp::DataType pixelDataType, unsigned int index )
    {
      if (! m_stereoEnabled )
      {
        return getTargetAsImage( GL_COLOR_ATTACHMENT0_EXT + index, pixelFormat, pixelDataType );
      }
      else
      {
        StereoTarget target = getStereoTarget();

        // Grab left and right image
        setStereoTarget( StereoTarget::LEFT );
        dp::util::ImageSharedPtr texLeft = getTargetAsImage( GL_COLOR_ATTACHMENT0_EXT + index, pixelFormat, pixelDataType );

        setStereoTarget( StereoTarget::RIGHT );
        dp::util::ImageSharedPtr texRight = getTargetAsImage( GL_COLOR_ATTACHMENT0_EXT + index, pixelFormat, pixelDataType );

        setStereoTarget( target );
#if 0
        return createStereoTextureHost( texLeft, texRight );
#else
        DP_ASSERT( !"There's no equivalent for createStereoTextureHost for dp::util::Image yet" );
        return dp::util::ImageSharedPtr::null;
#endif
      }
    }
Exemplo n.º 2
0
    dp::util::ImageSharedPtr RenderTargetFB::getImage( dp::PixelFormat pixelFormat
                                                     , dp::DataType pixelDataType
                                                     , unsigned int index )
    {
      if (! m_stereoEnabled )
      {
        return getTargetAsImage( isCurrent() ? GL_BACK : GL_FRONT );
      }
      else
      {
        StereoTarget target = getStereoTarget();

        // Grab left and right image
        dp::util::ImageSharedPtr texLeft = getTargetAsImage( getStereoTargetBuffer( StereoTarget::LEFT, isCurrent() ), pixelFormat, pixelDataType );
        dp::util::ImageSharedPtr texRight = getTargetAsImage( getStereoTargetBuffer( StereoTarget::RIGHT, isCurrent() ), pixelFormat, pixelDataType );
#if 0
        return createStereoTextureHost( texLeft, texRight );
#else
        DP_ASSERT( !"There's no equivalent for createStereoTextureHost for dp::util::Image yet" );
        return dp::util::ImageSharedPtr();
#endif
      }
    }