------------------------------------------------------------------------------
| 2005 | |
| 2006 | //------------------------------------------------------------------------------ |
| 2007 | void vtkTextureObject::CopyToFrameBuffer(vtkShaderProgram* program, vtkOpenGLVertexArrayObject* vao) |
| 2008 | { |
| 2009 | // the following math really only works when texture |
| 2010 | // and viewport are of the same dimensions |
| 2011 | float minXTexCoord = static_cast<float>(0.5 / this->Width); |
| 2012 | float minYTexCoord = static_cast<float>(0.5 / this->Height); |
| 2013 | |
| 2014 | float maxXTexCoord = static_cast<float>(static_cast<double>(this->Width - 0.5) / this->Width); |
| 2015 | float maxYTexCoord = static_cast<float>(static_cast<double>(this->Height - 0.5) / this->Height); |
| 2016 | |
| 2017 | float tcoords[] = { minXTexCoord, minYTexCoord, maxXTexCoord, minYTexCoord, maxXTexCoord, |
| 2018 | maxYTexCoord, minXTexCoord, maxYTexCoord }; |
| 2019 | |
| 2020 | float verts[] = { -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, 1.0f, 1.0f, 0.0f, -1.0f, 1.0f, 0.0f }; |
| 2021 | |
| 2022 | this->CopyToFrameBuffer(tcoords, verts, program, vao); |
| 2023 | } |
| 2024 | |
| 2025 | //------------------------------------------------------------------------------ |
| 2026 | void vtkTextureObject::CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax, |
no test coverage detected