0
votes

Is there a way to decouple the windows event loop from the directx rendering loop when rendering with DirectX and SharpDX via .NET?

That means i want to that rendering continues when i resize the window for example.

2

2 Answers

1
votes

Yes, You need to make a separate thread for your windows loop events.

You can use Systems.Threading library.

Remember rendering should be in Main thread, just create another thread for windows events, it will work.

1
votes

As a rule, you should never do your DirectX rendering on the applications main thread and this can't be emphasized enough.

After getting your rendering loop up and running on a separate System.Threading.Thread, incorporate a signaling mechanism like System.Threading.ManualResetEvent or System.Threading.ManualResetEventSlim to ensure that your rendering thread doesn't try to draw whilst you are resizing the SwapChain.

It's your rendering that needs to be done on a separate thread, not the handling of Windows messages. Hope this helps!