Kaydet (Commit) 482faead authored tarafından Louis-Francis Ratté-Boulianne's avatar Louis-Francis Ratté-Boulianne Kaydeden (comit) Markus Mohrhard

vcl: OpenGL coordinates are the inverse of VCL ones

Change-Id: I6c45673d3f438323d43b042e41d3401be280f6a4
üst 23aca19d
......@@ -310,9 +310,9 @@ void OpenGLSalGraphicsImpl::DrawConvexPolygon( sal_uInt32 nPoints, const SalPoin
void OpenGLSalGraphicsImpl::DrawRect( long nX, long nY, long nWidth, long nHeight )
{
long nX1( nX );
long nY1( nY );
long nY1( GetHeight() - nY );
long nX2( nX + nWidth );
long nY2( nY + nHeight );
long nY2( GetHeight() - nY - nHeight );
const SalPoint aPoints[] = { { nX1, nY2 }, { nX1, nY1 },
{ nX2, nY1 }, { nX2, nY2 }};
......@@ -386,8 +386,8 @@ void OpenGLSalGraphicsImpl::DrawTextureRect( const Size& rSize, const SalTwoRect
aTexCoord[0] = aTexCoord[2] = rPosAry.mnSrcX / (double) rSize.Width();
aTexCoord[4] = aTexCoord[6] = (rPosAry.mnSrcX + rPosAry.mnSrcWidth) / (double) rSize.Width();
aTexCoord[3] = aTexCoord[5] = rPosAry.mnSrcY / (double) rSize.Height();
aTexCoord[1] = aTexCoord[7] = (rPosAry.mnSrcY + rPosAry.mnSrcHeight) / (double) rSize.Height();
aTexCoord[3] = aTexCoord[5] = (rSize.Height() - rPosAry.mnSrcY) / (double) rSize.Height();
aTexCoord[1] = aTexCoord[7] = (rSize.Height() - rPosAry.mnSrcY - rPosAry.mnSrcHeight) / (double) rSize.Height();
glEnableVertexAttribArray( GL_ATTRIB_TEX );
glVertexAttribPointer( GL_ATTRIB_TEX, 2, GL_FLOAT, GL_FALSE, 0, aTexCoord );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment