javamultithreadingopengldisplaylist

Multithread OpenGL-List creation


I was wondered if there is a posibility to create a OpenGL-Display-List in a 2nd Thread. I tried it but I always got the same error: "No OpenGL-Context was found in the current thread".

Thanks for the help


Solution

  • OpenGL contexts are always bound to a single thread at a time. It's perfectly possible to migrate a OpenGL context between threads, but in doing to it gets detached from the thread it was in.

    But you can create multiple OpenGL contexts, each bound to a different thread and you can have the contexts share their Display Lists and textures (and other things).

    That being said, you shouldn't use Display Lists in new programs. They're deprecated and have been removed from modern versions of OpenGL.