BOOL CDlgDefineModel::OnInitDialog() { CDialog::OnInitDialog(); BOOL bEnable; if(m_pInvFcs->IsEmpty()) { bEnable = FALSE; CWnd* pWnd = GetDlgItem(IDC_FORWARD_MODEL); pWnd->EnableWindow(FALSE); pWnd = GetDlgItem(IDC_BROWSE_MODEL_NAME); pWnd->EnableWindow(FALSE); } else { bEnable = TRUE; if(m_pInvFcs->GetModelType() == CInvFcs::inv2D) m_nModType=0; if(m_pInvFcs->GetModelType() == CInvFcs::inv3D) m_nModType=1; m_pInvFcs->GetFileRoot(m_strFilePathModel); m_pInvFcs->GetPathTmp(m_strFilePathTmp); UpdateData(FALSE); SetMemoryCosts(); } if(m_nModType==0) Enable2D(FALSE); else Enable2D(TRUE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CDlgDefineModel::OnBnClickedModType3d() { int old = m_nModType; UpdateData(); if(m_nModType==1) Enable2D(TRUE); if(old != m_nModType && !m_pInvFcs->IsEmpty() ) { DestroyModel(); } }
void RenderFrame() { Enable2D(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); switch (WorldGame.GetScreen()) { case SCREEN_GAMEPLAY: { DrawGameplay(); break; } } glutSwapBuffers(); }