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

Author Topic: Delayed creation of window on MinGW  (Read 1633 times)

0 Members and 1 Guest are viewing this topic.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Delayed creation of window on MinGW
« on: October 09, 2011, 10:08:41 pm »
I don't get what's the difference because I use MinGW for Ruby as well and I don't experience that there but when doing it using pure C++ I get a 20 second delay.

My Log:
Quote
[INFO]   2011-10-09 22:04:03 -- void GDE::Init() : Development system is initiat
ing...
[INFO]   2011-10-09 22:04:03 -- int main() : Starting application...
[INFO]   2011-10-09 22:04:24 -- int main() : Window created
[INFO]   2011-10-09 22:04:27 -- void GDE::OnExit() : Application exiting...

Process returned 0 (0x0)   execution time : 24.193 s
Press any key to continue.


And my code is:
Code: [Select]
#include <GDE/GDE.hpp>
#include <GDE/RuntimeDisplayer.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>

int main()
{
    GDE::Init();
    GDE::GetLogger().SetLevel( GDE::Logger::DebugSeverity );
    GDE_INFO( "Starting application..." );
    sf::RenderWindow window;
    window.Create( sf::VideoMode( 800, 600 ), "Hello World!" );
    GDE_INFO( "Window created" );
    window.Show( true );
    sf::Clock clock;
    while( window.IsOpened() == true )
    {
        sf::Uint32 delta = clock.GetElapsedTime();
        clock.Reset();
        sf::Event event;
        while( window.PollEvent( event ) == true )
        {
            if( event.Type == sf::Event::Closed )
            {
                window.Close();
            }
        }

        window.Clear();
        GDE::RuntimeDisplayer::Update( delta );
        GDE::RuntimeDisplayer::Render( window );
        window.Display();
    }
    return 0;
}


Why am I experiencing such a huge delay before the Create function returns? And why don't I get a 20 second delay in rbSFML? Anyway it isn't really breaking but it makes debugging a lot slower as I have to wait before the application really kicks in.

UPDATE: Well after making it into a more complete application I get this log instead:
Quote
[INFO]   2011-10-09 23:10:00 -- void GDE::Init() : Development system is initiat
ing...
[INFO]   2011-10-09 23:10:00 -- void Game::Init() : Initiating application...
[INFO]   2011-10-09 23:10:22 -- void Game::Init() : Creating window...
[INFO]   2011-10-09 23:10:22 -- void Game::Init() : Everything done!
[INFO]   2011-10-09 23:10:24 -- void GDE::OnExit() : Application exiting...

Process returned 0 (0x0)   execution time : 23.902 s
Press any key to continue.


When initiating the application is when the window instance is actually allocated and then I call sf::Window::Create() later. As you see here I have the exact same 21 second delay here as before.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Delayed creation of window on MinGW
« Reply #1 on: October 15, 2011, 03:44:04 pm »
Alright I've tried everything now. I've tried compiling with static, debug, release, shared, on a different machine, every possible combination. At the first reference of SFML graphics specific code is about to be run it freezes. So I'm guessing that something funky in graphics context creation is being done.  Why it doesn't happen in rbSFML is a mystery to me.

Should I post this as an issue?
Developer and Maker of rbSFML and Programmer at Paradox Development Studio