Skip to main content
GameDev.net gamedev.net
🔒 Locked

Doubt in working with multi context application.

Started by Tsumuji Nov 24, 2006 at 12:29 PM 4 replies 1.9k views
Original Post
Tsumuji
Tsumuji
Is possible pass the textures generated in one OpenGL context to another? I have tried here and was sucessfull in creating a multi context in separate threads application. So, I have 2 windows running in parallel each one with own openGL context. And is working. But I want to know if it is possible to pass texturess generated by thread 2, to thread 1, so I can exibit textures loaded from thread 2 in thread 1?
MagicScript
MagicScript
Assuming that you're using Windows, you'll need to use wglShareLists on the two opengl resource contexts involved to be able to share things like textures between them.
Tsumuji
Tsumuji
hum, very good, but and in glX?
MagicScript
MagicScript
Quote:
Original post by Tsumuji
hum, very good, but and in glX?


I unfortunately don't have any experience with glX, but after a little searching, it appears that the list sharing functionality happens in glXCreateContext function where the third parameter specifies, I suppose, the context of your other window. I am, however, guessing. Good luck.

Reference for glXCreateContext
Tsumuji
Tsumuji
Yeah, I discover that yesterday at night. You're right. You need ro pass the parameter at creatin time with glXCreateContext();
Thanks for the replies!
Tsumuji
Tsumuji
one more doubt:
When I call wglShareLists, I pass the first parameter as my current context(the main context), and the second, the one I want to get the textures generated from?

I tried here, but get lost with the original image. Only the secondary context can be seen in screen now, not the main context.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.