SFML community forums

Help => General => Topic started by: awsumpwner27 on July 14, 2013, 11:58:59 am

Title: Maximizing window causes stack overflow
Post by: awsumpwner27 on July 14, 2013, 11:58:59 am
I was doing some testing, and I noticed this curiosity. When I would maximize my window, I would get a:
"Unhandled exception at 0x101fba76 in GameTestingSFML.exe: 0xC00000FD: Stack overflow."

The example included is essentially minimal, as it's just a slight derivative of the most basic example of SFML.

#include <SFML/Graphics.hpp>

int main(void){
        //Variable Definitions
        sf::RenderWindow window(sf::VideoMode::getFullscreenModes()[7], "SFML works!", 7);
                window.setFramerateLimit(60);

        sf::CircleShape shape(256.f);
                shape.setFillColor(sf::Color(191, 255, 127, 255));
                shape.setPointCount(48);

        //The Game Loop
        while (window.isOpen()){
                sf::Event event;
                //The Event Loop
                while (window.pollEvent(event)){

                        //Event type cases
                        switch(event.type){

                                //Window closed
                                case sf::Event::Closed:
                                        window.close();
                                break;

                                //Key pressed
                                case sf::Event::KeyPressed:

                                        //Keypress cases
                                        switch(event.key.code){

                                                //Escape key pressed
                                                case sf::Keyboard::Escape:
                                                        window.close();
                                                break;
                                        }
                                break;
                        }
                }

                window.clear();
                window.draw(shape);
                window.display();
        }

        return 0;
}
Title: Re: Maximizing window causes stack overflow
Post by: Laurent on July 14, 2013, 12:59:51 pm
OS?
Compiler?
Version of SFML?
...
Title: Re: Maximizing window causes stack overflow
Post by: awsumpwner27 on July 14, 2013, 01:23:08 pm
Whoops!
I suppose I wasn't being particularly helpful.

Windows Vista 32-bit
Microsoft Visual C++ 2010 Express
SFML 2.0 (From eXpl0it3r's unofficial nightly builds, which I downloaded on the 11th this month, so probably still the same version as the current one.)
Title: Re: Maximizing window causes stack overflow
Post by: Laurent on July 14, 2013, 01:43:25 pm
Quote
From eXpl0it3r's unofficial nightly builds, which I downloaded on the 11th this month, so probably still the same version as the current one
Nop, you should try a more recent one (I fixed this problem 2 or 3 days ago).
Title: AW: Maximizing window causes stack overflow
Post by: eXpl0it3r on July 14, 2013, 02:18:33 pm
My newest Nightly Builds include the said fix (see commit id), had the builds already ready for upload when the new commit came in, but you could always try to rebuilt them yourself. ;)
Title: Re: Maximizing window causes stack overflow
Post by: awsumpwner27 on July 15, 2013, 03:40:41 am
Okay, to be sure, I did rebuild SFML just now. When I tested it out again, I encountered the same problem. So, I'm not really sure what's up with this.
Title: Re: Maximizing window causes stack overflow
Post by: awsumpwner27 on July 15, 2013, 02:35:03 pm
I'll probably revert to the stable build to avoid the problem for now, but thank you for the responses.  :D
Title: Re: Maximizing window causes stack overflow
Post by: eXpl0it3r on July 15, 2013, 02:50:38 pm
Just tested it.
Works fine with my builds for Visual Studio 2010 and Visual Studio 2012 on a Windows 8 machine.

My best bet would be, that you've been still linking to the wrong version... :-\