gl rendering context + device context question

Started by
4 comments, last by jebediah123 19 years ago
Hi, I'm developing an win32 opengl application that's going to have multiple windows open in the application. Each window will be showing the 3d world but at different camera positions. Now, I've developed a Rendering target class that holds data including the HWND, HDC and HGLRC variables for each window. When I do the rendering I assume that I'll have to call wglMakeCurrent() function for each rendering target. My question is, when I'm loading stuff like textures do I have to load a texture for each rendering context or can I just load the texture under one of the rendering contexts and it be shared by all of the contexts? Does what I'm asking make sense? Thanks in advance.
Advertisement
If I remember correctly, each context has its own section of memory and is seperate of the rest. So you would have to load the texture into each one.

Someone correct me if I'm wrong please.
If thats the case you can probally use multiple viewports, or even call glProject multiple times for each view if you don't want to load the textures/data in each instance.
Normally, it's true that each context is separate, so you'd need to load each texture for each context. But, under Windows there's the call wglShareLists() which can share pretty much everything you'll need between two contexts. For Linux, I assume there's a similar call.
Quote:Original post by rjhcomputers
If I remember correctly, each context has its own section of memory and is seperate of the rest. So you would have to load the texture into each one.

Someone correct me if I'm wrong please.


That is correct, except you can use wglShareLists() to share the display-list space (display lists, texture, vbos, etc) between contexts.

I'm pretty sure there is an equivalent for linux, but I can't find it for some reason (I thought it was glxShareLists, but can't find anything on that on google).

EDIT: Whoops, beaten while searching for linux' version.
Thanks for all the responses folks, I'll take a look at wglShareLists. For the time being I believe I'll just need to share textures. Thanks.

This topic is closed to new replies.

Advertisement