LINUX.ORG.RU

Вряд ли можно использовать gl-функции в потоках. Я не уверен, но скорее всего потому, что функции Xlib и gl не являются thread-safe. Может получится через блокировки.

df_0903
()


http://doc.trolltech.com/qq/qq06-glimpsing.html

An additional problem under X11 is that Xlib (and therefore GLX) is not inherently thread-safe; doing Xlib calls in two different threads simultaneously will usually result in a crash. The GLX functions that the QGL module calls (e.g. for switching GL contexts, or for doing a buffer swap) also make Xlib calls which means that these calls must be protected in some way under X11. The simple solution is to call XInitThreads() before creating the QApplication object in your program. XInitThreads() must be the first Xlib call made in an application for it to work reliably. This will in effect make Xlib thread-safe.


ANDI ★★
()
Ответ на: комментарий от ANDI

но у меня рисует только один поток, если он уже запущен - он прерывается извне, и запускается заново.

CKulT
() автор топика
Ответ на: комментарий от CKulT

не работает нифига

QGLContext::makeCurrent(): failed

CKulT
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.