Multithreaded X11 application and OpenGL

前端 未结 3 1890
你的背包
你的背包 2021-01-02 12:58

I\'m trying to create a multithreaded opengl application with libx11 - with one separate thread per window, and one manager thread.

I have an event loop in the manag

3条回答
  •  心在旅途
    2021-01-02 13:25

    As eile said you should check that you use XInitThreads.

    I was able to get some good results from it when i used a background thread to do the window drawings of an animation. There seems to be no real problem if you stick to drawing code.

    If you need more then that and because you are using low level libX11 the best is just to open multiple X11 connections and use one connection per toplevel window. I did this 10 years ago when i played with developing a BeOS cross platform toolkit and when everything was in a worse state then it is now.

    You can use this even for event handling and child windows of a toplevel. But this needs some very tricky code for the XEvent masks.

提交回复
热议问题