Jump to content
  • Advertisement
Sign in to follow this  
mawerick

Using Display Lists in Multithreaded Application

This topic is 4331 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have an application with two threads, each having its own rendering context. One (first)thread prepares the data to be drawn in a display list, and when the data to be drawn is complete, it informs the other (second) thread. The second thread copies data from the display list created by the first thread into its own display list and renders it on to the screen.However this implementation causes an application crash after some time. Do anyone have an idea why?

Share this post


Link to post
Share on other sites
Advertisement
The crash could be for any number of reasons and without some further information the reason for the crash can't be deduced. Have you run the code in a debugger and if so, where did the crash happen?
On a different note, copying the display list each frame from one thread to the other seems like a big overhead. Why not try copying pointers to display lists instead?

Skizz

Share this post


Link to post
Share on other sites
If you have two contexts running on the same or compatible pixelformats, you normally use wglShareLists (or an equivalent function under other OSes) to unify the display list IDs (and all other OpenGL objects except occlusions) right after creation of the contexts, so that you can simply use the display list built in one context in the other. There's no need for a "copy", it's the same list.
If the pixelformats are not compatible (e.g. render_to_window and render_to_bitmap pixelformats often run on different OpenGL implementations), you cannot share any OpenGL context specific data among them via OpenGL. There you would need to create the display list in both contexts individually.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!