PDA

View Full Version : Problems with textures in a renderthread



Jason_Frost
11-22-2003, 12:15 AM
Hi,

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.

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

jwatte
11-22-2003, 10: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.

Jason_Frost
11-23-2003, 01:01 AM
hi!

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)