Threads and OpenGL
Here''s my basic scenario:
I''m writing a pictures screen saver in OpenGL. The program needs to load pictures as it goes. I''ve set up threads to load pictures in the background. These are the basic Win32 threads (_beginthread).
Here''s the problem:
Whenever certain functions are run by the threads, they screw up the output. The primary example is gluScaleImage. Anyone have any experience on how to fix this? I''m sure the thread''s finishing before the memory is being accessed for display. The functions work fine if I remove the thread.
Thank you sooo much!
OpenGL only works with access to a context from a single thread at any given time. If you wish to employ more than one thread, you must completely unload and disassociate the rendering context (and all associated objects) before switching threads. Since this normally isn''t very practical, the conventional wisdom is to restrict all OpenGL operations to a single thread.
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ ]
[ MS RTFM [MSDN] | SGI STL Docs | Boost ]
[ Google! | Asking Smart Questions | Jargon File ]
Thanks to Kylotan for the idea!
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ ]
[ MS RTFM [MSDN] | SGI STL Docs | Boost ]
[ Google! | Asking Smart Questions | Jargon File ]
Thanks to Kylotan for the idea!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement