SDI+splitter+OpenGL

I have an application that renders some scenes in OpenGL in standalone window. All stuff is in CMyProjectView class. I know how to make several OpenGL windows separated by splitter. Could anybody tell me how to change my program so that I have several views of the same CMyProjectView class separated by splitter in SDI application? Thank you in advance.

Hi,
This is a code for imlementing splitter in SDI application:
The example creates 2x2 splitter, with CMyProjectView class in every pane - you must have declared the
CSplitterWnd m_wndSplitter and OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) event in your class CMainFrame.
For additional info see MSDN help on CSplitterWnd and the example ViewEx

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if (!m_wndSplitter.CreateStatic(this, 2, 2))
return FALSE;

int nSizeX = (lpcs->cx)/2;
int nSizeY = (lpcs->cy)/2;

if (          !(m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CMyProjectView), CSize(nSizeX, nSizeY), pContext) &&
	m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CMyProjectView), CSize(nSizeX, nSizeY), pContext) &&
	m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CMyProjectView), CSize(nSizeX, nSizeY), pContext) &&
	m_wndSplitter.CreateView(1, 1, RUNTIME_CLASS(CMyProjectView), CSize(nSizeX, nSizeY), pContext))   )
{
	m_wndSplitter.DestroyWindow();
	return FALSE;
}

SetActiveView((CView*)m_wndSplitter.GetPane(0,0));

return TRUE;

}

However, expect terrible performance drop using this multiview rendering, as you must call wglMakeCurrent() in your OnDraw()
handler in class CMyProjectView,which is very slow operation. It’s better to implement several viewports in one view using glViewport().
See nVIDIA performance FAQ for more info on this subject.
(I know this also from my personal expirience in developing CAD applications… )

Hope this helps
Martin