SFML community forums
Help => Graphics => Topic started by: lorence30 on May 17, 2015, 05:50:09 pm
-
it says that you will get white screen when the texture the sprite is pointing is no longer alive.
heres my constructor
WeirdAlien::WeirdAlien()
{
_sprite.setTexture(loadAlien());
alien_position[ctr].x = ctr * 32;
++ctr;
}
void drawAlien(const int alien_count,const std::vector<Alien*>alien,const bool isAlienAlive[6],sf::RenderWindow& game_window)
{
for ( int a = 0; a < alien_count; a++ )
if (isAlienAlive[a])
game_window.draw(alien[a]->setSprite());
}
im still getting white square problem, why?
-
Can you give your full code? That which you've given references many functions which we can't see.
-
Can you give your full code? That which you've given references many functions which we can't see.
http://pastebin.com/Vc73FkTa
-
loadAlien returns a copy of an sf::Texture which gets instantly destroyed. Return an sf::Texture&
-
loadAlien returns a copy of an sf::Texture which gets instantly destroyed. Return an sf::Texture&
why i didnt notice that? :(
thanks