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

Author Topic: Random Window freeze  (Read 3663 times)

0 Members and 1 Guest are viewing this topic.

led

  • Newbie
  • *
  • Posts: 28
    • View Profile
Random Window freeze
« on: January 12, 2010, 08:36:23 pm »
Hey,
I do have this problem several times, but just after testing with the minimum code to run the SFML that I confirm this. I don't know why happens but, when I compile the project and the window pops up some times it freezes and if it is freezed I can't click anywhere because it doesn't work, only if I 'ALT+TAB' to choose other window. It also happens when the app runs great and then after a few moments (random time) freezes again. Its abit anoying, because before I test my game I need to test if the window isn't frozen, if it is I need to try to run again and again until the window runs correctly (if doesn't freeze again lol).
If you need any info just say.
Code: [Select]

#include <SFML/Graphics.hpp>

int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
   
    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear the screen (fill it with black color)
        App.Clear();

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}

linker: "sfml-system-s-d.lib sfml-window-s-d.lib sfml-graphics-s-d.lib"
Win XP SP3, VS 2008
while (!idle)
{
   DoSomething();
}

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Random Window freeze
« Reply #1 on: January 12, 2010, 08:49:24 pm »
Are your graphics drivers up-to-date? Did you try on other computers?
Laurent Gomila - SFML developer

led

  • Newbie
  • *
  • Posts: 28
    • View Profile
Random Window freeze
« Reply #2 on: January 12, 2010, 09:38:16 pm »
Like, i dowloaded the lastest drivers for my gfx card, and changed the build to 'Release' and tested on others pcs, with Win XP and Win 7 and it worked ok.
Well i returned to my compiler and compile the project (Release mode) and did ok...but i returned to the 'Debug mode' and it freezed again. :lol:
So what can cause the Debug mode to freeze?
while (!idle)
{
   DoSomething();
}

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Random Window freeze
« Reply #3 on: January 12, 2010, 11:10:45 pm »
I have no idea. You can do more tests to find which option make the debug configuration freeze (using debug SFML libraries? disabling optimizations? etc.).
Laurent Gomila - SFML developer

led

  • Newbie
  • *
  • Posts: 28
    • View Profile
Random Window freeze
« Reply #4 on: January 13, 2010, 12:03:40 am »
I forgot to mention that in the Debug mode in the linker i have sfml-graphics-s-d.lib, etc but in the Release mode i have sfml-graphics-s.lib and it only works great with the Release. Maybe something with the -d libs?
while (!idle)
{
   DoSomething();
}

led

  • Newbie
  • *
  • Posts: 28
    • View Profile
Random Window freeze
« Reply #5 on: January 13, 2010, 01:20:48 am »
The game is in Debug mode and without optimizations... me and my Professor tried to see what could be and nothing. Btw, im using a static library compiled by a friend. Im with VS 2008 Sp1... Any more suggestions?
while (!idle)
{
   DoSomething();
}

led

  • Newbie
  • *
  • Posts: 28
    • View Profile
Random Window freeze
« Reply #6 on: January 13, 2010, 01:38:09 am »
meh... just tried the Debug folder in my laptop and no problems atm :roll:
It seams the problem is withing my desktop computer... :(
Thanks for the help anyway.
while (!idle)
{
   DoSomething();
}