Advertisement

Mutithreading in openGL :(

Started by March 15, 2002 12:44 PM
0 comments, last by immy 22 years, 11 months ago
Hi all of you, hope every one is okay. The problem is i wanna make a display list(with GL_COMPILE ) in one thread & call(display) it in some other theard. But i can''t be able to do that . What am doing is creating a secondary thread thread from the main thread for display list creation & when the display list is completed i call it from the main thread. Butttt it does not work. I checked that glGenLists(num of lists) does not return a valid value when used from the secondary thread. Have any one got this problem too. Am sure some one must have faced this problem. All suggestions are welcomed. Bye take care all of you
manni
With threads you have to be absolutely sure that your threads share the same GL context.
Otherwise the display list will get a number in one''s context, and you''ll use it in another context where the list is not created.

When you have created your list, check the GL error (ie call glGetError after glEndList).

Also, check your list base.

Finally, call glIsList in both threads (when the list is created) to see if the list is shared.

And one another thing, you should call glFinish (or glFlush) after glEndList if you plan on calling the display list during the same frame that you created the list.

This topic is closed to new replies.

Advertisement