[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Threads and GL
From: |
Fred Kiefer |
Subject: |
Re: Threads and GL |
Date: |
Wed, 14 May 2008 19:03:59 +0200 |
User-agent: |
Thunderbird 2.0.0.12 (X11/20080226) |
Justin Kendrick wrote:
I'm trying to use a background thread to draw into a view using opengl.
Doing anything GL-related in a secondary thread segfaults, however.
Poking around AppKit and the X11 backend, I note that GSCurrentServer()
is returning NULL on every thread except the main one. I know that
secondary threads are not supposed to do any drawing, but this prevents
me from even making a context with shared state, drawing into a PBO, and
then blitting that into the view in the main thread.
I am fairly sure that it would be easy to get GSCurrentServer() return
something usable even on a secondary thread. But this still wouldn't be
of any use for you as most other operations will then fail. It seems
best to me to restructure your application to make use of the run loop
to do your drawing.
Cheers,
Fred
Just for completeness, but don't use it:
You could do the following in your back ground thread:
[GSDisplayServer setCurrentServer: GSServerForWindow(myWindow)];
- Threads and GL, Justin Kendrick, 2008/05/14
- Re: Threads and GL,
Fred Kiefer <=