Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED]Little problem with textures  (Read 1660 times)

0 Members and 1 Guest are viewing this topic.

Santa-Claus

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
[SOLVED]Little problem with textures
« 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,
« Last Edit: April 04, 2014, 12:15:40 pm by Santa-Claus »

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Little problem with textures
« Reply #1 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Little problem with textures
« Reply #2 on: April 04, 2014, 09:00:33 am »
Either pass in the address.

mP.setTexture(&mTexture);
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Santa-Claus

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Little problem with textures
« Reply #3 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 :/
« Last Edit: April 04, 2014, 11:46:26 am by Santa-Claus »

 

anything