SFML community forums

Help => General => Topic started by: Kami on September 11, 2019, 02:52:44 am

Title: No errors, but the window doesnt load anything.
Post by: Kami on September 11, 2019, 02:52:44 am
I am trying to make a program for my dads birthday, and learn SFML and C++. I have made everyhting work, then I decided I wanted to make it so the balloons switch colours. I have followed some instructions, and now it doesnt work. here is the code I used https://pastebin.com/zHjpFZpD. I just made it so that one side currently switches, then Ill make the other side switch once it works.
Title: Re: No errors, but the window doesnt load anything.
Post by: eXpl0it3r on September 12, 2019, 12:37:37 pm
Can you describe what is not working? :)
Title: Re: No errors, but the window doesnt load anything.
Post by: Kami on September 13, 2019, 06:24:37 am
Well, It isn't switching the pictures from balloon 4 to balloon 2. I got another code using pointers and it works, but I implemented it into everything and now it doesnt switch the pics. Not on my pc at the moment, so I can't get the new code.
Title: Re: No errors, but the window doesnt load anything.
Post by: Arcade on September 13, 2019, 04:04:10 pm
This looks to be where you're trying to toggle between different balloon sprites, but there are quite a few issues with it.

if (elapsed.asSeconds() <= 1){
            while (window.isOpen()) {
                activeSprite = (activeSprite == &balloon4Sprite ?
                    &balloon2Sprite :
                    &balloon4Sprite);
        }
    }
 

Title: Re: No errors, but the window doesnt load anything.
Post by: Kami on September 13, 2019, 04:32:12 pm
I went to reddit first and posted here to be safe, but I am now using pointers and my phone to do it. See my reply above for more info