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

Author Topic: Draw sprite into a thread  (Read 5956 times)

0 Members and 1 Guest are viewing this topic.

skarwild

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Draw sprite into a thread
« on: May 24, 2014, 02:03:34 pm »
Hello,
I would like to draw a sprite from a thread but I get the following error:
Failed to create texture, size invalid (0x0)
while my code looks good.
My code:
               Sprite s = this.listAnim.get(count).getImage(); // return a sprite
               s.setPosition(x+5,y+10);
               render.draw(s);
thank you

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Re: Draw sprite into a thread
« Reply #1 on: June 10, 2014, 06:18:53 am »
Well, the error message concerns the failure of creating a texture, which happens way before you create the sprite. You seem to create a texture of 0x0 size, and that won't work.

If you can't figure out what's wrong, please post the code that you use for loading your texture?
JSFML - The Java binding to SFML.