//******************************************** // Draw //******************************************** int CPath3d::glDraw() { if(!m_Show) return 0; if(m_ArrayVertex.GetSize() == 0) return 0; glColorMaterial(GL_FRONT, GL_DIFFUSE); glEnable(GL_COLOR_MATERIAL); // Build list at first if(!m_ListDone || m_Modified) glBuildList(); // Search for a new list if(::glIsList(m_ListOpenGL)==GL_TRUE) { ::glDisable(GL_LIGHTING); // paths have lighting disabled ::glCallList(m_ListOpenGL); return 1; } else { return 0; } }
//******************************************** // glDraw //******************************************** void CSceneGraph3d::glDraw(void) { if(!m_ListDone) glBuildList(); unsigned int size = m_ArrayObject3d.GetSize(); for(unsigned int i=0; i<size; i++) { CObject3d *pObject3d = m_ArrayObject3d[i]; // Texture if(pObject3d->GetType() == TYPE_MESH3D) { CMesh3d *pMesh = (CMesh3d *)pObject3d; int IndexTexture = pMesh->GetTextureIndex(); if(IndexTexture >= 0) { ASSERT(glIsTexture(m_pIndexTextureBinding[IndexTexture])); glBindTexture(GL_TEXTURE_2D,m_pIndexTextureBinding[IndexTexture]); TRACE("Texture : %d\n",m_pIndexTextureBinding[IndexTexture]); } // Drawing pObject3d->glDraw(); } else pObject3d->glDraw(); } }
//******************************************** // glDraw // draw only type //******************************************** void CSceneGraph3d::glDraw(int type) { if(!m_ListDone) glBuildList(); unsigned int size = m_ArrayObject3d.GetSize(); for(unsigned int i=0; i<size; i++) { CObject3d *pObject3d = m_ArrayObject3d[i]; if(pObject3d->GetType() == type) pObject3d->glDraw(); } }
//******************************************** // Draw //******************************************** int CPath3d::glDraw() { if(!m_Show) return 0; if(m_ArrayVertex.GetSize() == 0) return 0; glColorMaterial(GL_FRONT, GL_DIFFUSE); glEnable(GL_COLOR_MATERIAL); // Build list at first if(!m_ListDone || m_Modified) glBuildList(); int nlists = m_nPointsInList/m_nPointsPerList; if ((m_nPointsInList % m_nPointsPerList) != 0)nlists++; for (int i=0; i<nlists; i++) { int List = *m_ListArray.GetAt(i); // Search for a new list if(::glIsList(List)==GL_TRUE) { ::glDisable(GL_LIGHTING); // paths have lighting disabled ::glCallList(List); } else { return 0; } } return 1; }