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

Author Topic: Segmentation fault when trying to draw sprite[10]  (Read 1696 times)

0 Members and 1 Guest are viewing this topic.

paupav

  • Full Member
  • ***
  • Posts: 156
    • View Profile
    • Email
Segmentation fault when trying to draw sprite[10]
« on: November 21, 2015, 03:50:13 am »
i have pointer in second cpp which points to window and when im trying to draw sprite[10] I get segmentation fault.

window->draw(boxS[10]);

shadowmouse

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
Re: Segmentation fault when trying to draw sprite[10]
« Reply #1 on: November 21, 2015, 09:47:44 am »
Please post your code, but as a random guess, is boxS of size 10?

paupav

  • Full Member
  • ***
  • Posts: 156
    • View Profile
    • Email
Re: Segmentation fault when trying to draw sprite[10]
« Reply #2 on: November 23, 2015, 04:09:11 pm »
That was the problem. thanks  8)

it is giving me unexpected behaviour when I'm trying to load texture when number of sprites isn't defined ( sprite[]; ) .

 

anything