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

Author Topic: Maximizing window causes stack overflow  (Read 2927 times)

0 Members and 1 Guest are viewing this topic.

awsumpwner27

  • Newbie
  • *
  • Posts: 27
    • View Profile
Maximizing window causes stack overflow
« 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;
}

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Maximizing window causes stack overflow
« Reply #1 on: July 14, 2013, 12:59:51 pm »
OS?
Compiler?
Version of SFML?
...
Laurent Gomila - SFML developer

awsumpwner27

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Maximizing window causes stack overflow
« Reply #2 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.)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Maximizing window causes stack overflow
« Reply #3 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).
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: Maximizing window causes stack overflow
« Reply #4 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. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

awsumpwner27

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Maximizing window causes stack overflow
« Reply #5 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.

awsumpwner27

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Maximizing window causes stack overflow
« Reply #6 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

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Maximizing window causes stack overflow
« Reply #7 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... :-\
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/