Share OpenGL context between multiple processes

BlitzMax Forums/OpenGL Module/Share OpenGL context between multiple processes

beanage(Posted 2009) [#1]
Hey guys,

little question that keeps me thinking. Is it possible, to have two or even more processes reading and writing data (eg. images) from and to the very same OpenGL context?

My ideas run into a direction of procedural terrain, where you have a bunch of detail-heightmaps (or for testing just one), which get(s) interpreted by a gpu terrain renderer hosted by a main process, but written from procedural data (splines, plane functions, etc) by a child process..

(not sure if the word of "context" is right here)

Thanx for fast answers,

BeAnAge


beanage(Posted 2009) [#2]
mmh.. can i just use wglMakeCurrent() to use the very same? and what about other platforms?


N(Posted 2009) [#3]
I don't think you'll have much luck sharing contexts between processes - as far as I know, it's impossible under both Mac OS and Linux, and the same is probably true of Windows. Your best bet is probably to use a separate thread and render to an offscreen buffer. Oh, and if you do share contexts between threads, for the love of god, make sure you have a critical section around your graphics code. It's the same as using, say, Print in multiple threads.