Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can two processes render to one OpenGL canvas?

I have three different processes running on the same machine. One of them owns an OpenGL window. I would like the other two to be able to render (quickly) to different rectangular portions of the OpenGL window.

If I can guarantee that they will nicely take turns executing OpenGL commands, is this possible?

Many thanks

Hugo Elias

like image 619
Rocketmagnet Avatar asked Jan 16 '09 18:01

Rocketmagnet


2 Answers

Under Windows, it is possible with threads of the same process.

The function you are looking for is wglMakeCurrent:

http://msdn.microsoft.com/en-us/library/dd374387%28VS.85%29.aspx

like image 174
heeen Avatar answered Nov 15 '22 11:11

heeen


My understanding is that this is not possible with any existing drivers. An OpenGL context is owned by just one process.

It's even dicey for two threads within a single process to each be making OpenGL calls to a single OpenGL context. (That doesn't need to be so by design, but it is often a problem with current drivers.)

like image 30
Larry Gritz Avatar answered Nov 15 '22 10:11

Larry Gritz