Exemplo n.º 1
0
    void RenderTargetFBO::blit( const RenderTargetFBSharedPtr & destination, const BlitMask & mask, const BlitFilter & filter )
    {
      GLint binding;

      TmpCurrent current = TmpCurrent(this);

      glGetIntegerv( GL_FRAMEBUFFER_BINDING_EXT, &binding );
      m_bindingStack.push_back( binding );
      glBindFramebuffer( GL_FRAMEBUFFER_EXT, m_framebuffer );

      resizeAttachments( m_stereoTarget );
      bindAttachments( m_stereoTarget );

      // restore old binding
      glBindFramebuffer( GL_FRAMEBUFFER_EXT, binding );
      m_bindingStack.pop_back();

      BlitRegion destRegion(0,0, destination->getWidth(), destination->getHeight());
      BlitRegion srcRegion(0,0, this->getWidth(), this->getHeight());
      blit(0, mask, filter, destRegion, srcRegion);
    }
Exemplo n.º 2
0
bool Win32Graphics::checkBoundaries( int x_src, int y_src,
                                     int w_src, int h_src,
                                     int& x_target, int& y_target,
                                     int& w_target, int& h_target )
{
    // set valid width and height
    w_target = (w_target > 0) ? w_target : w_src;
    h_target = (h_target > 0) ? h_target : h_src;

    // clip source if needed
    rect srcRegion( x_src, y_src, w_src, h_src );
    rect targetRegion( x_target, y_target, w_target, h_target );
    rect inter;
    if( rect::intersect( srcRegion, targetRegion, &inter ) )
    {
        x_target = inter.x;
        y_target = inter.y;
        w_target = inter.width;
        h_target = inter.height;
        return true;
    }
    return false;
}
Exemplo n.º 3
0
 void RenderTargetFBO::blit( const RenderTargetFBOSharedPtr & destination, const BlitMask & mask, const BlitFilter & filter )
 {
   BlitRegion destRegion(0,0, destination->getWidth(), destination->getHeight());
   BlitRegion srcRegion(0,0, this->getWidth(), this->getHeight());
   blit(destination->getFramebufferId(), mask, filter, destRegion, srcRegion);
 }