View Full Version : Problems with textures in a renderthread

11-21-2003, 11:15 PM

i have the problem, that my textures arent working in a rederthread. The rest works fine but my globject ist always white if i want to map a texture on it. Before the thread starts it works fine but if the thread renders sth .... problems.
the drawing of opengl objects is working fine, i have written a switchRC method for the thread and it works fine. Only textures doesn´t work.

Any ideas?

I hope anyone knows a solution.

PS: The programm is an MFC OpenGL application.

11-21-2003, 11:56 PM
If you are using two different rendering contexts, you'll need to use wglShareLists() to share texture objects between them.

11-22-2003, 09:30 AM
You should also remember to wglMakeCurrent(0,0) after you're done drawing, so that the context is "fully available" to the other thread, as a context can only be current in one thread at a time.

In general, it's a bad idea to render to OpenGL from more than one thread. It forces the driver to do lots of (expensive) synchronization.

11-23-2003, 12:01 AM

first thanks a lot. I will try your suggestions. I render only from one thread but this thread can be stopped and resumed. Why I do this is a long story an its sunday morning and i dont want to tell a boring story ;o)