SFML forum,
Windows 7 Professional 64 bit, SFML Version 10.0.4, mingw-w64
Here's my code and any texture file should work for testing since
I know mine works because I've used it with other programs.
#include <SFML/Graphics.hpp>
#include <iostream>
#define XSIZE 600
#define YSIZE 600
class BOX
{
public:
BOX(unsigned int count) :
edges(sf::Points, count){}
~BOX() {}
sf::VertexArray edges;
int l, cx, cy;
void load_edges()
{
int i; int x = cx-l; int y = cy-l;
for(i = 0; i<l*2; i++)
{edges[i].position = sf::Vector2f(x++,y);}
for(; i<l*4; i++)
{edges[i].position = sf::Vector2f(x,y++);}
for(; i<l*6; i++)
{edges[i].position = sf::Vector2f(x--,y);}
for(; i<l*8; i++)
{edges[i].position = sf::Vector2f(x,y--);}
}
void assign_variables(int x, int y, int z)
{cx = x; cy = y; l = z;}
};
int main()
{
BOX box(400);
box.assign_variables(XSIZE/2, YSIZE/2, 50);
sf::Texture texture;
if (!texture.loadFromFile("C:/users/Jerry/Desktop/sprites/concrete.jpg"))
{std::cout << " Error loading concrete texture" << std::endl; system("pause");}
sf::RenderWindow window(sf::VideoMode(XSIZE, YSIZE), "BOX");
box.load_edges();
sf::Event event;
while(window.isOpen())
{
while (window.pollEvent(event))
{ if(event.type == sf::Event::Closed) {window.close();} }
window.draw(box.edges, &texture);
window.display();
window.clear();
}
return 0;
}
jerryd