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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - pummelFlummel

Pages: [1]
1
Window / Re: Multiple windows each in own thread
« on: September 08, 2016, 06:00:00 pm »
Ok, thank you :)

2
Window / Re: Multiple windows each in own thread
« on: September 07, 2016, 04:02:40 pm »
Yes, I am. For instance DarkRokus code above runs fine for one thread.
Didn't try the other modules.

I downloaded the VS 14 version of SFML 2.4 and I'm using the VS 14 Community Edition Update 3.

But the latest improvements since 2.3.2 dont seem to be dramatical, so I will simply use the older version now.

3
Window / Re: Multiple windows each in own thread
« on: September 07, 2016, 02:50:28 pm »
Thank you for the quick reply and for your effort to try this.

I used SFML 2.4.0 x64 with Visual Studio 2015.

Now I set up the 2.3.2 and it works! (x86 and x64)

Is this a new feature or a new bug? Can't find anything in the changelog.

4
Window / Multiple windows each in own thread
« on: September 06, 2016, 09:05:13 pm »
I want a console application that is able to create some small sfml-windows that appear next to the console.
My idea was to leave logical computations together with console io in the main thread and to create a new thread for each external window to handle events etc.

I tried things like:

void spawn()
{
        sf::RenderWindow w(sf::VideoMode(400, 400), "external");
        w.setActive(true);

        while (w.isOpen())
        {
                sf::Event event;
                while (w.pollEvent(event))
                        if (event.type == sf::Event::Closed)
                                w.close();

                w.clear();
                w.display();
        }
}

void main()
{
        std::thread(&spawn).detach();
        std::thread(&spawn).detach();

        std::cin.get();
}

I also experimented with creating the window in the main thread and passing it to the functions (with deactivating it before).
However, as soon as I try to spawn more than one external window, I always get an stack overflow error.

Is it possible to handle multiple windows like that? What am I missing here?
Thanks.

Pages: [1]
anything