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

Author Topic: Moved View when using sf::Sound or debugging  (Read 1192 times)

0 Members and 1 Guest are viewing this topic.

antagon

  • Newbie
  • *
  • Posts: 1
    • View Profile
Moved View when using sf::Sound or debugging
« on: September 07, 2018, 06:00:53 pm »
Hello people,
I'm very new here and i have a problem.

I'm working on a project in sfml wich is several thousand lines big at this point. Because of this i'm not posting any code at first because i have no idea where the problem might accure.

My View is changing, when i use any part of sf::Sound (even if i just mention sf::Sound in any .h file without using it). The same problem accures if i open the debugg mode. But if i use sound and the debug mode the view is normal (Pictures attached).

If anyone can help me or has some kind of idea where to search, thank you.
Have a nice day ! 

(The first picture is the normal view, the second when using sf::Sound, the third in debugging and the last one when using both)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Moved View when using sf::Sound or debugging
« Reply #1 on: September 08, 2018, 12:59:55 am »
Usually when unrelated code "magically" influences other code parts, it points to uninitialized variables or undefined behavior.
Make sure you properly initialize every plain-type. If you for example just write int i; then i isn't initialized and can contain any value. The reason why it may work in debug mode is, because often times the memory is 0-initialized by default in debug mode, so the uninitialized variable may suddenly not contain just any junk data, but is actually 0.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything