PDA

View Full Version : OpenGL splitter windows



martinjy
05-21-2001, 11:39 AM
Do I need one unique class for each splitter window?

I'm programming OpenGL MFC and my COpenGL class is directly descended from CView. As I dynamically create static splitter windows, I wonder if I can use the same class on all splitter windows, or do I have to derive different classes from COpenGL?

anybody?

bsimser
05-21-2001, 12:09 PM
It's probably best to create a class for each splitter window so you don't have to keep track of the different options for each view separately. I'm not sure what you're trying to do, but lets say you want to do a 4-way splitter with 4 views (front, top, side and 3D). Create a CView derived class (CGLView) to handle the base OpenGL stuff (like setting up the device context and handling the WM_ERASEBKGND message) then create 4 new classes from CGLView for each of your views. In these classes you can specify the camera angle through a gluLookAt command or glRotate commands. Use these classes in each of the splitter windows in your OnCreateClient method.

Hope that helps.

liB

martinjy
05-21-2001, 03:55 PM
thanx!