SFML community forums

Help => Graphics => Topic started by: Santa-Claus on April 04, 2014, 08:43:57 am

Title: [SOLVED]Little problem with textures
Post by: Santa-Claus on April 04, 2014, 08:43:57 am
Hello everyone,

So i'm having a problem with the texture loading in my application.
The error:
Code: [Select]
None, just not loading also no error that it's not finding the file or anything
Some codes:
in Game.cpp
Code: [Select]
, mTexture()
Code: [Select]
mPlayer.setTexture(mTexture);in void Game::render() (in Game.cpp)
Code: [Select]
mWindow.draw(mPlayer);In Game.hpp
Code: [Select]
sf::Texture mTexture;
Kind Regards,
Santa-Claus,
Title: Re: Little problem with textures
Post by: Jesper Juhl on April 04, 2014, 08:56:06 am
The function takes a const texture *pointer* but you are passing a texture. The error message states this quite plainly.
Title: Re: Little problem with textures
Post by: eXpl0it3r on April 04, 2014, 09:00:33 am
Either pass in the address.

mP.setTexture(&mTexture);
Title: Re: Little problem with textures
Post by: Santa-Claus on April 04, 2014, 10:01:25 am
This was really a fail of me i used a shape and wanted to make a sprite sorry for that :/