Thank for your kindly reply,
but i think i post the source code will make it more easy to discuss …right?
Can u please figure it out:
Init()
{
float fov = 60;
float a_ratio;
float znear = 1;
float zfar = 10000;
CRect rect;
timer = this->SetTimer(0, 1, NULL);
map_window_dc =
m_ViewPortTop.GetDC()-> m_hDC;
Left_window_dc =
m_ViewPortLeft.GetDC()->m_hDC;
Front_window_dc =
m_ViewPortFront.GetDC()->m_hDC;
All_window_dc =
m_ViewPortAll.GetDC()->m_hDC;
SetWindowPixelFormat(map_window_dc);
SetWindowPixelFormat(Left_window_dc);
SetWindowPixelFormat(Front_window_dc);
SetWindowPixelFormat(All_window_dc);
map_window_rc =
wglCreateContext (map_window_dc);
Left_window_rc =
wglCreateContext(Left_window_dc);
Front_window_rc =
wglCreateContext(Front_window_dc);
All_window_rc =
wglCreateContext(All_window_dc);
//***************************************** // Setup Top ViewPort
//****************************************** wglMakeCurrent(map_window_dc,
map_window_rc);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glShadeModel(GL_SMOOTH);
//glEnable(GL_LIGHTING);
//glEnable(GL_LIGHT0);
glEnable(GL_COLOR_MATERIAL);
glEnable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
m_ViewPortTop.GetClientRect(&rect);
w_top = rect.right;
h_top = rect.bottom;
a_ratio = w_top / h_top;
glViewport(0,0, (GLsizei) w_top,
(GLsizei) h_top);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(fov, a_ratio, znear, zfar);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
//// Setup Left ViewPort
// wglMakeCurrent(Left_window_dc,
Left_window_rc);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glShadeModel(GL_SMOOTH);
//glEnable(GL_LIGHTING);
//glEnable(GL_LIGHT0);
glEnable(GL_COLOR_MATERIAL);
glEnable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
m_ViewPortLeft.GetClientRect(&rect);
w_left = rect.right;
h_left = rect.bottom;
a_ratio = w_left / h_left;
glViewport(0,0, (GLsizei) w_left,
(GLsizei) h_left);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(fov, a_ratio, znear, zfar);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
//Font ViewPort…(same as above except
variable…)
//All viewport…
}
DrawLeft()
{
wglMakeCurrent(Left_window_dc,
Left_window_rc);
glClear(GL_COLOR_BUFFER_BIT |
GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
Render();
glFlush();
SwapBuffers(Left_window_dc);
}
DrawFront()
{
wglMakeCurrent(Front_window_dc,
Front_window_rc);
glClear(GL_COLOR_BUFFER_BIT |
GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
Render();
glFlush();
SwapBuffers(Front_window_dc);
}