View Full Version : Shader Programs and DC's
Can the same shader program be used in more than one DC at the same time?
03-23-2005, 05:59 PM
Should be no problem.
03-23-2005, 09:22 PM
Well, Im not sure... For example you can install two graphics card, AGP & PCI (geforce/ati + matrox g450). This is two different DC and when you create GLRC on both DC, I'm quite sure that you cant share objects between this two RC's.
03-24-2005, 03:10 PM
DC/RC, same **** different name. :p No, you're quite right. Mixed it up. You can share program objects between GL contexts, but you can obviously not share contexts between implementations on different GPUs, nor can you share between two processes.
Thanks everybody for your posts...
My situation here, is that I have multiple windows in the same application. I need to change the palettes in all of them at the same time by replacing the 1D textures. I do not need different shading code to do this. I created only one shader program and tried to use it in the displaying function of all the windows. The shader didn't work except for one window. When I created multiple copies of the same shader programs and assigned one program to every window, it worked fine. I am new to shading, can there be anything that I did wrong or is there an obvious reason for that thet I don't know? :eek: :)
03-25-2005, 11:47 PM
Check out for wglShareLists()
03-26-2005, 02:02 AM
Instead creating rendering context (RC) for all windows you can create one RC for all. Just override OnPaint event and do wglMakeCurrent at beggining and SwapBuffers at end of this func. Remember to call SetPixelFormat with same PixelFormat for all windows.
No object sharing, but you must track GL state changes.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.