01-12-2001, 05:19 AM
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.
01-14-2001, 11:36 PM
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))
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)) )
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.. http://www.opengl.org/discussion_boards/ubb/smile.gif)
Hope this helps
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.