Shader Programs and DC's


Can the same shader program be used in more than one DC at the same time?

Should be no problem.

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.


DC/RC, same **** different name. :stuck_out_tongue: 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: :slight_smile:

Check out for wglShareLists()

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.


This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.