View Full Version : Sharing textures and RCs
02-07-2003, 04:47 PM
If I have more than one rendering context, and I want to use the same texture
in each of them, do I have to create this texture again in each RC? Essentially
having 4 copies of the same texture?
Or can I create the texture once with glGenTextures and share its texture_id
among all these rendering contexts?
02-07-2003, 05:12 PM
You should be able to use wglShareLists for Windows or its equivalent on other platforms. glXCreateContext for XWindows platforms.
Texture names and their contents are local to the shared display list space of the current GL rendering context. Two rendering contexts share texture names only if they also share display lists. (This is mentioned in the OpenGL Reference Manual (blue book) under glBindTexture)
02-07-2003, 05:57 PM
Great, thanks. I didn't know about wglShareLists.
02-07-2003, 08:12 PM
From the Win32 docs for wglShareLists:
"You can only share display lists with rendering contexts within the same process."
Can wglShareLists be used to share texture IDs in two or more threads?
Not sure if "process" is equivalent to "thread".
02-08-2003, 10:29 AM
The answer is yes, you can share textures between threads too.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.