I have built an OpenGL Viewer control that can simply be dropped onto a windows form (at design time) and assigned an OpenGL display list (at run time).
The viewer control handles navigation, display options (e.g. background color), etc. It is also responsible for creating and destroying rendering and device contexts as necessary.
Obviously, each viewer control instance has its own device context, the 'window' where the image is drawn.
Questions:
- How should each viewer control instance manage rendering contexts?
- Should each instance have it's own context or share a global rendering context?
I'm particularly concerned with how this affects WGL font creation (wglUseFontBitmaps and wglUseFontOutlines), which requires a rendering context (whatever the current context is) and a device context.
- Do I need to create each WGL font for each rendering/device context combination?
Perhaps my approach is flawed.