First of all, this is mostly an OpenGL question, but since my OpenGL knowledge isn't very extensive, my searches aren't being fruitful in solving the problem, and that my issue may be related to some specific code in SFML, I'm posing it here.
I'm trying to extend a Sprite to allow for Mode-7 (
http://en.wikipedia.org/wiki/Mode_7) rendering.
I have decided to attempt to inherit from Sprite and overload Render().
Initially, I just want to deform the sprite in a way that the upper edge is smaller than the lower ("scaling" the sprite's upper edge). To do this, I'm simply changing the coordinates for the sprite's top vertices, in the followin manner:
(in Sprite::Render, replacing the OpenGL rendering part with:)
glBegin(GL_QUADS);
glTexCoord2f(Rect.Left, Rect.Top); glVertex2f(Width * 0.25f, 0);
glTexCoord2f(Rect.Left, Rect.Bottom); glVertex2f(0, Height);
glTexCoord2f(Rect.Right, Rect.Bottom); glVertex2f(Width, Height);
glTexCoord2f(Rect.Right, Rect.Top); glVertex2f(Width - (Width * 0.25f), 0) ;
The resulting image has a weird deformation along the line where the polygons meet, not mapping the texture smoothly along the deformed quad.
Original image:
Result image:
What I intended image (mockup):
Can anyone point me towards some info? Sorry if it's offensive to be this off-topic