Hi.
Ok, so I have a quad, that is not a retangle nor square. It's a trapezoid.
Basically, the quad act as if it's a pair of triangles and texture becomes deformed the farer its' shape goes away from a square.
In case problem is on my end I attached the screens of what I see.
In case problem is not on my end, is this the desired and/or expected behaviour?
I didn't look very carefully through documentation but only thing I could notice is the warning about integer texture coords(but irrelevant here).
Here the code and image to reproduce the problem, press any key to increase the trapezoidness of the quad, press any mouse button to toggle texture smoothing(doesn't help):
#include <SFML/Graphics.hpp>
int main(int argc,char * argv[])
{
sf::RenderWindow app(sf::VideoMode(600,600),"");
sf::VertexArray arr(sf::Quads);
sf::Vector2f pts[4];
pts[0]=sf::Vector2f(0.f,0.f);
pts[1]=sf::Vector2f(0.f,64.f);
pts[2]=sf::Vector2f(64.f,64.f);
pts[3]=sf::Vector2f(64.f,0.f);
sf::Texture tex;
tex.loadFromFile("laser.tga");
tex.setSmooth(true);
float test=0.f,max=512.f;
arr.append(sf::Vertex(sf::Vector2f(0.f,0.f),pts[0]));
arr.append(sf::Vertex(sf::Vector2f(0.f,max),pts[1]));
arr.append(sf::Vertex(sf::Vector2f(max,max-test),pts[2]));
arr.append(sf::Vertex(sf::Vector2f(max,test),pts[3]));
while(1)
{
sf::Event eve;
while(app.pollEvent(eve))
{
if(eve.type==sf::Event::KeyPressed)
{
test+=1.f;
arr.clear();
arr.append(sf::Vertex(sf::Vector2f(0.f,0.f),pts[0]));
arr.append(sf::Vertex(sf::Vector2f(0.f,max),pts[1]));
arr.append(sf::Vertex(sf::Vector2f(max,max-test),pts[2]));
arr.append(sf::Vertex(sf::Vector2f(max,test),pts[3]));
}
if(eve.type==sf::Event::MouseButtonPressed)
{
tex.setSmooth(!tex.isSmooth());
}
}
app.clear(sf::Color::Green);
app.draw(arr,&tex);
app.display();
}
}
[attachment deleted by admin]