I have some questions !!!
Someone knows a good tutorial about the implementation of different threads within a openGL application. I want to separate sensing, the API and the rendering from my application.
Is it possible to separate the rendering (different windows) in threads?
I’m not sure but I think to remember GL context(s) is(are) shared per-process.
As far as I know, there can be only 1 context per-process active at a given point in time. So, no, you cannot have 1 thread per window, each with its own render context (provided what I remember is correct) - unless each window is a different process obviously.
As for the rest, I don’t think it’s different from managing a standard shared resource.
Having input and rendering on different threads does not look so difficult.
I can tell the OpenGL superbible has a chapter on this but I don’t know if you can find resources on the net. Threading is usually seen as a black beast.
Obli, you’re far off.
In OpenGL a context can only be current in one thread at a time, and a thread can only have one current context. Given that multithreading is pretty simple.
Multiple windows of the same process can have multiple threads rendering to them each using its own context very easily.
You can even render to the same window with multiple threads, each holding its own context.
Such contexts can share data with wglShareLists as long as the windows use pixelformats from the same OpenGL implementation.
Cross-process OpenGL context access is illegal.
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.