[not a bug] bug in COpenGLDriver::draw2DImage( ... )
Posted: Wed Nov 14, 2007 11:20 pm
I saw the code in function:
And there are some lines of code:
Shouldn't be:
???
With code <1>, if the tcoords is bigger then the rect of the texture, the texture doesn't grow/stretch, but multiplies itself into that rect![Laughing :lol:](./images/smilies/icon_lol.gif)
With code <2> it works just fine.
But I don't know if this is a bug or if that was the design of that function ...
Code: Select all
void COpenGLDriver::draw2DImage(const video::ITexture* texture,
const core::position2d<s32>& pos,
const core::rect<s32>& sourceRect,
const core::rect<s32>* clipRect, SColor color,
bool useAlphaChannelOfTexture)
Code: Select all
glTexCoord2f(tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
glVertex2f(GLfloat(poss.UpperLeftCorner.X), GLfloat(poss.UpperLeftCorner.Y));
glTexCoord2f(tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
glVertex2f(GLfloat(poss.LowerRightCorner.X), GLfloat(poss.UpperLeftCorner.Y));
glTexCoord2f(tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
glVertex2f(GLfloat(poss.LowerRightCorner.X), GLfloat(poss.LowerRightCorner.Y));
glTexCoord2f(tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
glVertex2f(GLfloat(poss.UpperLeftCorner.X), GLfloat(poss.LowerRightCorner.Y));
Code: Select all
glTexCoord2f(0, 0);
glVertex2f(GLfloat(poss.UpperLeftCorner.X), GLfloat(poss.UpperLeftCorner.Y));
glTexCoord2f(1, 0);
glVertex2f(GLfloat(poss.LowerRightCorner.X), GLfloat(poss.UpperLeftCorner.Y));
glTexCoord2f(1, 1);
glVertex2f(GLfloat(poss.LowerRightCorner.X), GLfloat(poss.LowerRightCorner.Y));
glTexCoord2f(0, 1);
glVertex2f(GLfloat(poss.UpperLeftCorner.X), GLfloat(poss.LowerRightCorner.Y));
With code <1>, if the tcoords is bigger then the rect of the texture, the texture doesn't grow/stretch, but multiplies itself into that rect
![Laughing :lol:](./images/smilies/icon_lol.gif)
With code <2> it works just fine.
But I don't know if this is a bug or if that was the design of that function ...