Hello, when i call my drawgame function in the following code it just paints a white square where the picture are supposed to be. the square have the right proportions and such its just white...
#include "Gamestate.cpp"
#include "Player.cpp"
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
using namespace std;
class Model {
private :
int hej;
Gamestate* gamestate;
Player* player;
sf::Sprite Sprite1;
public :
Model();
void updategame();
void drawgame(sf::RenderWindow *App);
};
Model::Model(){
sf::Image Image1;
Image1.SetSmooth(false);
Image1.LoadFromFile("trans.png");
Sprite1.SetImage(Image1);
Sprite1.SetPosition(500,-1);
}
void Model::drawgame(sf::RenderWindow *App){
Sprite1.SetPosition(500,-1);
App->Draw(Sprite1);
}
Also it works fine if I load the picture in the drawgame function
void Model::drawgame(sf::RenderWindow *App){
sf::Image Image1;
Image1.SetSmooth(false);
Image1.LoadFromFile("trans.png");
sf::Sprite Sprite1(Image1);
Sprite1.SetPosition(500,-1);
App->Draw(Sprite1);
}