How do I use Qt and SDL together?

后端 未结 3 1127
北恋
北恋 2020-12-08 04:44

I am building a physics simulation engine and editor in Windows. I want to build the editor part using Qt and I want to run the engine using SDL with OpenGL.

My firs

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 05:04

    While you might get it to work like first answer suggest you will likely run into problems due to threading. There is no simple solutions when it comes to threading, and here you would have SDL Qt and OpenGL mainloop interacting. Not fun.

    The easiest and sanest solution would be to decouple both parts. So that SDL and Qt run in separate processes and have them use some kind of messaging to communicate (I'd recommend d-bus here ). You can have SDL render into borderless window and your editor sends commands via messages.

提交回复
热议问题