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

Author Topic: Crashing when rectangle setSize  (Read 1799 times)

0 Members and 1 Guest are viewing this topic.

aaroncm

  • Newbie
  • *
  • Posts: 20
    • View Profile
Crashing when rectangle setSize
« on: October 03, 2012, 08:57:47 am »
Hey guys. I'm having some trouble using setSize. Basically, I have a timeline class, and I created one rectangle for a 'background', and one to use as a line. (There's probably better ways to create a line, but this still seems to be a problem) So, I create the background rectangle, set its position, size and draw it, no problem. But I have another rectangle called tLine, and whenever I try to set it's size, it crashes. If I comment out setSize, it crashes on window->draw(tLine);. I can, however, set it's position.

This is weird, I can do all that fine with rect, the background rectangle :s

Here's my class:

http://pastebin.com/P7NhdkaM

Thanks for any help in advance =)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10818
    • View Profile
    • development blog
    • Email
Re: Crashing when rectangle setSize
« Reply #1 on: October 03, 2012, 09:13:00 am »
Does it work when you use a size > 1?
For lines it's probably better to use a sf::VertexArray.

I adivse you to always write the full class name and not to use 'usinge namespace sf'. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

aaroncm

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Crashing when rectangle setSize
« Reply #2 on: October 03, 2012, 09:19:35 am »
Oh ok, I'll do that. But I did try various sizes and it won't seem to stop crashing  :(

 

anything