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 - BlueX

Pages: [1]
1
General / Re: Event thread
« on: October 25, 2013, 03:29:47 pm »
The code's missing.

There is no need to show the code, i explained everything...

To quote from the official tutorial.

Quote
Events must be polled in the window's thread

This is an important limitation of most OSes: the event loop (more precisely, the pollEvent or waitEvent function) must be called in the same thread that created the window. This means that if you want to create a dedicated thread for event handling, you'll have to make sure that the window is created in this thread too. If you really want to split things between threads, it is more convient to keep event handling in the main thread and move the rest (rendering, physics, logic, ...) to a separate thread instead. This configuration will also be compatible with the other limitation described below.

Thanks i didn't see that in sfml tutorial, thanks a lot :D

2
General / Event thread
« on: October 25, 2013, 01:46:54 am »
Hello,

I'm creating a game and i create a thread to handle all events in the game, but the problem is that when i use the thread my aplications freezes and crash, i runed  a debug and i figured that the problem was with the thread. so i did this:

Code: [Select]
//events_thread.launch();
But it still crashing, so i realise that i need to use the event loop in the main fuction, which is game_start.

So my question is why i can't use a event thread? And how much threads can i create?

Thanks.

Here is the code expleined:


Pages: [1]
anything